|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-12-10 11:06 UTC] tony2001@php.net
[2006-12-18 01:00 UTC] php-bugs at lists dot php dot net
[2008-07-09 11:48 UTC] kpobococ at gmail dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 01:00:01 2025 UTC |
Description: ------------ This was some code I had been using since migrating to PHP5 since about 5.1.2 I believe at least, has worked since then until the server got upgraded to PHP 5.2.0 In short, I have a database call that gets made before the function, the database return can be NULL if no one has added anything into it (its a banned IP result, if no IPs are banned, result is NULL). Basically what happens is if I do implode("," array($data['banned']));, in PHP 5.2 now it causes what seems to be the PHP CGI to fail (My server gives me a '400 Internal Server Error' message). Sadly I don't have access to apache logs and such, so I can't give you much more beyond that. PHP Configure Command: ../configure --program-suffix=5 --with-pear=/usr/local/lib/php5 --with-config-file-path=/usr/local/lib/php5 --with-libxml-dir=/usr/local/php5 --without-sqlite --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-soap --with-xsl=/usr/local/php5 --enable-mbstring=all --with-curl=/usr/local/php5 --with-mcrypt=/usr/local/php5 --with-gd --with-pdo-mysql=/usr/local/mysql --with-freetype-dir --with-libxml-dir=/usr/local/php5 --with-mysql=/usr/local/mysql --with-zlib --enable-debug=no --enable-safe-mode=no --enable-discard-path=no --with-png-dir=/usr/lib --enable-track-vars --with-db --with-gdbm --enable-force-cgi-redirect --with-ttf=/usr/ --enable-ftp --enable-dbase --enable-memory-limit --enable-calendar --enable-wddx --with-jpeg-dir=/usr/src/php5/jpeg-6b --enable-bcmath --enable-gd-imgstrttf --enable-shmop --enable-mhash --with-mhash=/usr/src/php5/mhash-0.8.9/ --with-openssl --enable-xslt --with-xslt-sablot --with-dom --with-dom-xslt --with-dom-exslt --with-imap --with-iconv=/usr/local --with-bz2 --with-gettext --enable-exif --with-idn Reproduce code: --------------- $ban_array = implode(",", array($data['Banned'])); if (strstr($ban_array, $_SERVER['REMOTE_ADDR'])) { die("Banned"); } Expected result: ---------------- That used to (if an IP matched in the banned IP's array from the database) pop up the 'Banned' error message, else if the database value for 'Banned' came back NULL, it would still continue to process with no errors. I managed to work around this now in PHP 5.2 however by replacing the $ban_array line and adding another line before it, like such: $banned = array(ltrim($data['Banned'])); $ban_array = implode(",", $banned); Actual result: -------------- Function ends up causing the server to kick out a 400 Internal Server Error, no script process, nothing, so error reporting variables didn't do nothing to show anything, cause it seems to cause the PHP CGI itself to fail some how.