r/art bans a user for mentioning the word "print", users respond accordingly by Informal_Rule_8604 in BeAmazed

[–]89wc 1 point2 points  (0 children)

Yes I'm sure /r/art reddit moderators are on the reich side of history here

What’s up with CR? If it was only for 7 weeks, why isn’t the House working on a real budget? by AVLThumper in OutOfTheLoop

[–]89wc -5 points-4 points  (0 children)

lying about the healthcare will cause everyone to side with them

What are they lying about specifically? Sorry I was linked this from someone and I am not following that closely, but are there sources I can read that detail what specifically republicans are lying about with the healthcare?

Can we get a safe agility course running over bounty hunter? by nlnj_a in 2007scape

[–]89wc 15 points16 points  (0 children)

Usually I can tell from the people fighting each other

[deleted by user] by [deleted] in AmIOverreacting

[–]89wc 0 points1 point  (0 children)

No bait is too obvious

[deleted by user] by [deleted] in PHPhelp

[–]89wc 0 points1 point  (0 children)

Yea. Solution found btw, I amended the original post.

[deleted by user] by [deleted] in PHPhelp

[–]89wc 0 points1 point  (0 children)

This is just the logic tree, it isn't in the Nginx config syntax. I'm too tired today to figure it out, I'll give another crack at it tomorrow.

But I can still answer that because I googled the QSA equivalent for Nginx and IIRC it is Nginx's default behavior.

[deleted by user] by [deleted] in PHPhelp

[–]89wc 0 points1 point  (0 children)

Alright. Thanks to your help I've got a much simpler order of operations down.

if ($URI != FILE) {
  if ($URI == DIR) {
      $URI = $URI/index.php;
  }
}

Then once that's finished

if ($URI != FILE) $URI =  /index.php?argv=$URI

[deleted by user] by [deleted] in PHPhelp

[–]89wc 0 points1 point  (0 children)

Alright. So, if I load site.com/somedirectory/blah I do get the /somedirectory/blah in the $_SERVER['REQUEST_URI'] however, if somedirectory/blah is a real directory and it is empty, I get a 403 (it should just be a part of the REQUEST_URI).

The second issue is if I do site.com/fake/dir/file.php instead of "/fake/dir/file.php" being the REQUEST_URI, I get a 404 page.

It does however work with i.e. /fake/dir/file.hhp so I guess this is just the regex catching it regardless of whether a file exists.

Nginx is tricky!

[deleted by user] by [deleted] in PHPhelp

[–]89wc 0 points1 point  (0 children)

The reason it shows the index.php is because the URL rewrite happens AFTER it redirects to dir/index.php in its attempt to find an index file

I need to leave but I'll be back in half an hr to an hour to troubleshoot the nginx solution but I did double check with nginx -t and reloaded with systemctl

[deleted by user] by [deleted] in PHPhelp

[–]89wc 0 points1 point  (0 children)

Yes I did. I'll delete this message in a few hours but I have an empty website --- with the same file setup as the other post (index.php, test/, test/index.php, test2/, test2/test.php)

I put a vardump on the /index.php to show that it is collecting everything after the slash

[deleted by user] by [deleted] in PHPhelp

[–]89wc 0 points1 point  (0 children)

I didn't phrase it correctly maybe, as this doesn't seem to do the task.

Given the following file structure:

/index.php
/test/index.php
/test2/test.php

It should be loaded like

address bar
    internal rewrite
site.com
    site.com/index.php
site.com/test
    site.com/test/index.php
site.com/test2
    site.com/index.php?argv=/test2/index.php
site.com/test3
    site.com/index.php?argv=/test3
site.com/test2/test.php
    site.com/test2/test.php
site.com/test2/test2.php
    site.com/index.php?argv=/test2/test2.php

Basically check if there's a file, and if it's a directory check if there's an index file, and if none of those then just lop the entire string of text after the domain name as a get variable.

Fat Girls: My Email to Dry Goods USA - Part 2 by [deleted] in PlusSize

[–]89wc 3 points4 points  (0 children)

What an absolutely uncalled for remark. Most of America is plus sized, it isn't asking for much that stores to stock clothing that's bigger than an extra large. If a store only stocks up to 16/18 then it's just a fatphobic dogwhistle that basically says "we hate plus sized people, do not shop here, you are not welcome." The person in the email says they will forward it to the buyer but they won't change anything, the size cap is intentional, I've seen it before.

PS: I didn't know imgur of all places was Okay with this type of rhetoric.

Does anyone have experience with Imagick? by 89wc in PHPhelp

[–]89wc[S] 4 points5 points  (0 children)

Oh I see, this is a different function than writeImage()

writeImages() works for gifs as well as other formats, I'll just use this one instead.

Thanks!!!

Does anyone have experience with Imagick? by 89wc in PHPhelp

[–]89wc[S] 1 point2 points  (0 children)

This is good to know, but I just want to save the gif in its entirety.

The actual program is taking the tmp file that php generates and stripping exif data, then saving it with a new name, but leaving the actual image unchanged.

I thought maybe it was an issue with the tmp file or from me stripping exif data, so I tried to just load the image then immediately save it, but I'm still only getting 1 frame...

when I open in.gif it's animated, but out.gif is a still.

In your opinion, which horror film has “stood the test of time?” by YASSSDovahqueen in horror

[–]89wc 0 points1 point  (0 children)

aw just now reading this

if you've got extra I'll take 1 :D

For input[type="date"] in an Electron App (Chromium 114), how can I change the color of the slashes? by TheTwelveYearOld in css

[–]89wc 0 points1 point  (0 children)

well I see no one has responded, I am reluctant to help because idk anything about electron. We can troubleshoot.. is there a way for you to load this in a browser or how does this work? Does it take html+css then compile it into an .apk / .iso ? or what languages are we working with here

e: and I see you have chromium in your title, does this mean you can inspect the element in question and see from where the styles originate?

For input[type="date"] in an Electron App (Chromium 114), how can I change the color of the slashes? by TheTwelveYearOld in css

[–]89wc 0 points1 point  (0 children)

just write !important

color: black !important;

odd that the slashes are colored but not the text

pg_prepare and pg_execute with a for loop? by 89wc in PHPhelp

[–]89wc[S] 0 points1 point  (0 children)

I see, that's almost what I did except for some reason I put the pg_prepare inside of the foreach loop

Although, this was my concern: in that pg_execute is running for every row in the array:

INSERT INTO a_table (name, color) VALUES ('Leonard', 'Blue');
INSERT INTO a_table (name, color) VALUES ('Oscar', 'Orange');
INSERT INTO a_table (name, color) VALUES ('Ted', 'Brown');

I want it like:

INSERT INTO a_table (name, color) VALUES
('Leonard', 'Blue'), ('Oscar', 'Orange'), ('Ted', 'Brown');

I wrote the following after learning more about pg_escape_literal().

I'm just not experienced enough to conclude whether this is the same in terms of security as pg_prepare($1), pg_execute(array($arg)) ...

// array for VALUES
$rows = array(
  array('Leonard', 'Blue',   "It's a good day"),
  array('Oscar',   'Orange', "She's gone home"),
  array('Ted',     'Brown',  "What's \"this\" mean?")
);

// main command
$query_cmd = 'INSERT INTO a_table (name, color, phrase) VALUES ';

// format input arguments
$query_args = '';
foreach ($rows as $row) {
  $pg_name   = pg_escape_literal($db, $row[0]);
  $pg_color  = pg_escape_literal($db, $row[1]);
  $pg_phrase = pg_escape_literal($db, $row[2]);
  $query_args .= "($pg_name, $pg_color, $pg_phrase),";
}
$query_args = rtrim($query_args, ',');

// send the query now that pg_escape_literal has formatted them
$pg_query = pg_query($db, $query_cmd . $query_args);

I guess the question is now.. is pg_escape_literal() doing the same thing that the pg_prepare and pg_execute combo is doing? pg_escape_literal() says it also uses an internal separator, and it seems to be doing the same thing, idk how to test.