mirror of
https://github.com/cypht-org/cypht.git
synced 2026-04-25 04:56:03 +03:00
[GH-ISSUE #370] Cypht does not recognize Ajax request under PHP-FPM #316
Labels
No labels
2fa
I18N
PGP
Security
Security
account
advanced_search
advanced_search
announcement
api_login
authentication
awaiting feedback
blocker
bug
bug
bug
calendar
config
contacts
core
core
devops
docker
docs
duplicate
dynamic_login
enhancement
epic
feature
feeds
framework
github
github
gmail_contacts
good first issue
help wanted
history
history
imap
imap_folders
inline_message
installation
keyboard_shortcuts
keyboard_shortcuts
ldap_contacts
mobile
need-ssh-access
new module set
nux
pop3
profiles
pull-request
question
refactor
release
research
saved_searches
smtp
strategic
tags
tests
themes
website
wordpress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cypht#316
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @fabiomontefuscolo on GitHub (Jan 28, 2020).
Original GitHub issue: https://github.com/cypht-org/cypht/issues/370
Originally assigned to: @jasonmunro on GitHub.
🐛 Bugreport
This is not Cypht bug itself, but a very weird behavior that happens when using PHP-FPM (FastCGI). Probably, it is desired to workaround this to let FastCGI users to use Cypht.
The problem is Cypht is not recognizing Ajax requests as Ajax. Even having
HTTP_X_REQUESTED_WITHin the global$_SERVER. That happens because Cypht usesfilter_input_arrayto filter values from fromSERVERscope.From my XDebug terminal:
filter_input_arraybehaves likefilter_inputfor this issue.For some reason,
INPUT_ENVworks, but I don't think it is reliable.Version & Environment
Rev:
c3fd36ad7bOS: Linux
Steps to reproduce
@fabiomontefuscolo commented on GitHub (Jan 28, 2020):
https://bugs.php.net/bug.php?id=49184&thanks=6
@jasonmunro commented on GitHub (Feb 6, 2020):
@fabiomontefuscolo sorry for the late follow up, and thanks for the thorough report. Surely we can come up with a work-around. This may not be a Cypht bug, but if a solution can be implemented that isn't too ugly I'm open to it. I will look more closely as soon as I can. Thanks again for the feedback!
@marclaporte commented on GitHub (Apr 23, 2020):
I wonder if this is issue is present in other operations.
@jasonmunro commented on GitHub (May 5, 2020):
I test this with PHP-FPM 7.4 configured as FastCGI with Nginx and was unable to reproduce. Maybe it was fixed in PHP for 7.4?
@fabiomontefuscolo commented on GitHub (May 9, 2020):
Ok! I will run my applications on php 7.4 then. Thank you!
@jasonmunro commented on GitHub (May 9, 2020):
@fabiomontefuscolo make sure you are on the latest master git checkout as I have made a number of PHP 7.4 specific fixes lately.
@marclaporte commented on GitHub (May 10, 2020):
hmmm. I think we should support PHP 7.2, 7.3 and 7.4 as per https://www.php.net/supported-versions.php
@jasonmunro commented on GitHub (May 11, 2020):
@marclaporte We do as evidenced here: https://travis-ci.org/github/jasonmunro/cypht
However as the OP pointed out, the fact that request headers are being dropped from the built in SERVER array under this specific configuration is a bug in PHP and not something we can easily (or safely) work around. If this continues to be a problem we can re-address it, however it's possible a fix was made and backported to PHP 7.* so for now I'm comfortable with the solution being "upgrade to PHP 7.4 if you are using FastCGI via FPM, or use a different interface to PHP"