CORE-POS / IS4C

Cooperative Operational Retail Environment
http://www.core-pos.com
GNU General Public License v2.0
63 stars 44 forks source link

Add another `filter_input()` fallback for FastCGI #1167

Closed lgedgar closed 1 year ago

lgedgar commented 1 year ago

this fixes fairly major REST routing bugs with FastCGI

see also https://github.com/CORE-POS/IS4C/pull/1154

Grep tells me there are ~130 instances of the string filter_input(INPUT_SERVER just in the fannie/ subdir alone.

Not sure these are all worth fixing, vs. should just declare FastCGI "not supported" - but this one is fairly low-hanging fruit which can affect lots of the app, so figured might as well.

gohanman commented 1 year ago

FWIW FastCGI is supported just fine. This particular problem only happens if FastCGI has not been configured correctly.

lgedgar commented 1 year ago

I can't say I know enough to argue the point, but it's not clear to me what might be wrong with the config in question, what might be done to fix etc. This is on a shared host online, so maybe our options are just too limited there.

But online clues mostly tell me to avoid FastCGI:

So again not really arguing the point - I'll just try to avoid FastCGI myself..but wanted to jot down the notes at least.

lgedgar commented 1 year ago

Ah, finally found this comment which suggests the culprit may be the auto_globals_jit setting. Presumably that should be OFF in order to fix this with FastCGI? Sure enough it is ON for the system I had problems with. (And not clear if I'm able to modify that setting, b/c shared hosting...) Anyway FYI.

gohanman commented 1 year ago

I'm not exactly sure on fixes. Literally every non Windows instance of CORE that I have is using FastCGI, and none of them have this issue (including one on shared hosting). It seems like most distros just get this right with their default, provided config.

lgedgar commented 1 year ago

FYI, that auto_globals_jit seems to have done the trick. Feel free to revert this and https://github.com/CORE-POS/IS4C/pull/1154 if they no longer accomplish anything useful.