Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(adminer): php 8 warning of undefined variable #2645

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cubercsl
Copy link
Contributor

@cubercsl cubercsl commented Aug 5, 2024

I am trying to debug domjudge main branch with adminer, but some data is not displayed correctly and I got a 502 error in the nginx log.

image
image

... - - [05/Aug/2024:14:20:09 +0000] "GET /jury/adminer?username=&db=domjudge HTTP/2.0" 200 9835 "https://.../jury/adminer?username=&db=" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36"
2024/08/05 14:20:10 [error] 998059#998059: *9783 FastCGI sent in stderr: "PHP message: PHP Warning:  Undefined variable $dg in /opt/domjudge/webapp/resources/adminer.php on line 868; PHP message: PHP Warning:  Undefined variable $dg in /opt/domjudge/webapp/resources/adminer.php on line 868; PHP message: PHP Warning:  Undefined variable $dg in /opt/domjudge/webapp/resources/adminer.php on line 868; PHP message: PHP Warning:  Undefined variable $dg in /opt/domjudge/webapp/resources/adminer.php on line 868; PHP message: PHP Warning:  Undefined variable $dg in /opt/domjudge/webapp/resources/adminer.php on line 868; PHP message: PHP Warning:  Undefined variable $dg in /opt/domjudge/webapp/resources/adminer.php on line 868; PHP message: PHP Warning:  Undefined variable $dg in /opt/domjudge/webapp/resources/adminer.php on line 868; PHP message: PHP Warning:  Undefined variable $dg in /opt/domjudge/webapp/resources/adminer.php on line 868; PHP message: PHP Warning:  Undefined variable $dg in /opt/domjudge/webapp/resources/adminer.php on line 868; PHP message: PHP Warning:  Undefined variable $dg in /opt/domjudge/webapp/resources/adminer.php on line 868; PHP message: PHP Warning:  Undefined variable $dg in /opt/domjudge/webapp/resources/adminer.php on line 868; PHP message: PHP Warning:  Undefined variable $dg in /opt/domjudge/webapp/resources/adminer.php on line 868; PHP message: PHP Warning:  Undefined variable $dg in /opt/domjudge/webapp/resources/adminer.php on line 868; PHP message: PHP Warning:  Undefined variable $dg in /opt/domjudge/webapp/resources/adminer.php on line 868; PHP message: PHP Warning:  Undefined variable $dg in /opt/domjudge/webapp/resources/adminer.php on line 868; PHP message: PHP Warning:  Undefined variable $dg in /opt/domjudge/webapp/resources/adminer.php on line 868; PHP message: PHP Warning:  Undefined variable $dg in /opt/domjudge/webapp/resources/adminer.php on line 868; PHP message: PHP Warning:  Undefined variable $dg in /opt/domjudge/webapp/resources/adminer.php on line 868; PHP message
2024/08/05 14:20:10 [error] 998059#998059: *9783 upstream sent too big header while reading response header from upstream, client: ..., server: ..., request: "GET /jury/adminer?username=&db=domjudge&script=db HTTP/2.0", upstream: "fastcgi://unix:/var/run/php-fpm-domjudge.sock:", host: "localhost", referrer: "https://.../jury/adminer?username=&db=domjudge"

Replacing this $dg with $y in webapp/resources/adminer.php can resolve this issue. (This is guessed by comparing the mapping relationship between the source and compressed code variable names.)

See also: vrana/adminer#450

@nickygerritsen
Copy link
Member

The other suggestion, adding $GLOBALS['sql'] =& $GLOBALS['jush']; to the place where we include adminer, doesn't work? I find that a bit more clean.

@vmcj
Copy link
Member

vmcj commented Aug 25, 2024

@cubercsl will you implement the other method or should we do this ourselves?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants