[If you have comments on this please send e-mail to me]

I think PHP4.0.4pl1 has unsafe code for 8bit char codes. I suspect PHP4 does
this:

PHP4 behavior: Script is executed TWICE and included file is not processed
1) PHP parse script and start executing.
   - The script check username data in db, if there is the same username,
return error. If not, insert new username into db.
2) PHP encounters 8bit char unclean code some where near include() and
restart script execution from the beginning for some reason.
   - The script written to include() file for successful user registration.

PHP inserts new username into db at 1st execution, then it finds the same
username in db and return error for 2nd execution. If I put die('died here')
BEFORE include(), PHP stops execution and outputs 'died here'. but not AFTER
include(). I was using 'ob_gzhandler', disabling it does not make
difference.

This happened when user registration check/insert was done in function
defined in included file. PHP also does not log any errors.

PHP4 behavior: Script does not process included file and outputs default
HTML.
1) PHP parse script and start executing.
2) PHP encounters 8bit char unclean code some where near include(), and
outputs default HTML for null output and stops execution for some reason.

Therefore, I can see output from die('died here') if I put BEFORE include(),
but not AFTER include().

This happened when user registration check/insert was done in the script
itself. The script logic is identical.  PHP does not log any errors.

I use EUC (Extended Unix Code), EUC-JP to be specific,  for char code, which
is supposed to work well with 8bit char code clean programs.

[Environment]
OS: RadHat Linux7.0.1/ja(i386) FTP version (no glibc update)
Apache: Apache 1.3.17 w/ mod_ssl-2.8.0, mod_gzip-1.13.17a. build from source
PHP: PHP4.0.4pl1 w/ pgsql-7.0.3, gd-1.8.3, mhash, mcript and others. build
from source.
 - ECU-JP for all html,  php scripts
PHP Configure:
'./configure' '--with-apxs' '--disable-short-tags' '--enable-bcmath'
'--with-zlib-dir' '--enable-ftp' '--with-imap' '--with-mhash'
'--with-mcrypt' '--with-pgsql' '--with-swf' '--enable-sysvsem'
'--enable-sysvshm' '--with-zlib' '--enable-iconv' '--with-kakasi'
'--enable-jstring' '--enable-mbregex' '--with-namazu'
'--with-gd=../gd-1.8.3/' '--with-jpeg-dir=/usr' '--with-xpm-dir=/usr/X11R6'

I cannot think of any reasonable explanation for this strange PHP4 behavior
other than possibility that glibc has bugs. (8bit char unsafe code, etc. I
haven't research about my exact glibc version nor bugs yet.)

Any comments appreciated.

--
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to