[PHP-DEV] PHP 4.0 Bug #5508 Updated: Crash when using get variables From: sniper <email protected>
Date: 01/30/01

ID: 5508
Updated by: sniper
Reported By: franck_marcia <email protected>
Old-Status: Feedback
Status: Closed
Bug Type: Reproduceable crash
Assigned To:
Comments:

No feedback. If problem still exists with PHP 4.0.4pl1
reopen this bug report.

--Jani

Previous Comments:
---------------------------------------------------------------------------

[2000-12-27 05:23:32] jmoore <email protected>
Can you please try this with the latest version (404) of PHP from either php.net or php4win.de. I could not reproduce this behaviour myself.

James

---------------------------------------------------------------------------

[2000-10-11 11:59:23] zak <email protected>
Duplicated bug in Win98 using 4.0.3RC2

---------------------------------------------------------------------------

[2000-08-20 02:55:03] sniper <email protected>
No feedback from user.

--Jani

---------------------------------------------------------------------------

[2000-07-27 22:04:11] zak <email protected>
Cannot duplicate error using same ini file on win 98. Could you try to provide a very short script that causes the same error?

---------------------------------------------------------------------------

[2000-07-11 10:57:45] franck_marcia <email protected>
Windows 98 crash description :
------------------------------------------------------
PHP a causé une défaillance de pile dans le module MSVCRT.DLL à 0177:7800130e.
Registres :
EAX=00000000 CS=0177 EIP=7800130e EFLGS=00010246
EBX=00791910 SS=017f ESP=00542000 EBP=00824b80
ECX=00542048 DS=017f ESI=0065d010 FS=5dd7
EDX=0054204c ES=017f EDI=7800c9ac GS=0000
Octets à CS : EIP :
ff 15 4c 30 03 78 ff 35 08 b0 03 78 8b f8 ff 15
État de la pile :
7800c9ac 0065d010 7800c9b1 1009a2d8 0065d07a 0065d010 00791910 1009b45e 100cc7a0 100cc6f4 000000aa 00542050 0054204c 00542048 00542054 0065d07a
------------------------------------------------------
Apache log
------------------------------------------------------
[Mon Jul 10 16:38:33 2000] [error] [client 127.0.0.1] Premature end of script headers: c:/program files/apache/cgi-bin/php/php.exe
------------------------------------------------------
PHP.INI (without any comment)
------------------------------------------------------
[PHP]
zend_optimizer.optimization_level=15
zend_extension_ts="C:WindowsSystemZendOptimizer.dll"
engine=On
short_open_tag=Off
asp_tags=Off
precision=14
y2k_compliance=Off
output_buffering= Off
implicit_flush= Off
allow_call_time_pass_reference= Off
safe_mode=Off
safe_mode_exec_dir=
safe_mode_allowed_env_vars = PHP_
safe_mode_protected_env_vars = LD_LIBRARY_PATH
disable_functions=
highlight.string=#DD0000
highlight.comment=#FF8000
highlight.keyword=#007700
highlight.bg=#FFFFFF
highlight.default=#0000BB
highlight.html=#000000
expose_php=On
max_execution_time = 30
memory_limit = 8388608
error_reporting=E_ALL & ~E_NOTICE
display_errors=On
log_errors=Off
track_errors=Off
warn_plus_overloading=Off
variables_order="EGPCS"
register_globals=On
register_argc_argv=Off
track_vars=Off
gpc_order="GPC"
magic_quotes_gpc=Off
magic_quotes_runtime=Off
magic_quotes_sybase=Off
auto_prepend_file=
auto_append_file=
default_mimetype = "text/html"
include_path=
doc_root=
user_dir=
upload_max_filesize = 2097152
extension_dir=c:/windows/system/inetsrv/php/
enable_dl= On
extension=php_calendar.dll
extension=php_imap.dll
extension=php_ldap.dll
extension=php_zlib.dll
extension=php_ftp.dll
extension=php_exif.dll

[Syslog]
define_syslog_variables= Off

[mail function]
SMTP=localhost
sendmail_from=me <email protected>

[Debugger]
debugger.host=localhost
debugger.port=7869
debugger.enabled=true

[Logging]

[SQL]
sql.safe_mode=Off

[ODBC]
uodbc.allow_persistent=On
uodbc.check_persistent = On
uodbc.max_persistent=-1
uodbc.max_links=-1
uodbc.defaultlrl=4096
uodbc.defaultbinmode= 1

[MySQL]
mysql.allow_persistent=On
mysql.max_persistent=-1
mysql.max_links=-1
mysql.default_port=
mysql.default_socket=
mysql.default_host=
mysql.default_user=
mysql.default_password=

[mSQL]
msql.allow_persistent=On
msql.max_persistent=-1
msql.max_links=-1

[PostgresSQL]
pgsql.allow_persistent=On
pgsql.max_persistent=-1
pgsql.max_links=-1

[Sybase]
sybase.allow_persistent=On
sybase.max_persistent=-1
sybase.max_links=-1
sybase.min_error_severity=10
sybase.min_message_severity=10
sybase.compatability_mode= Off

[Sybase-CT]
sybct.allow_persistent=On
sybct.max_persistent=-1
sybct.max_links=-1
sybct.min_server_severity=10
sybct.min_client_severity=10

[bcmath]
bcmath.scale=0

[browscap]

[Informix]
ifx.default_host=
ifx.default_user=
ifx.default_password=
ifx.allow_persistent=On
ifx.max_persistent=-1
ifx.max_links=-1
ifx.textasvarchar=0
ifx.byteasvarchar=0
ifx.charasvarchar=0
ifx.blobinfile=0
ifx.nullformat=0

[Session]
session.save_handler = files
session.save_path = /tmp
session.use_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.serialize_handler = php
session.gc_probability = 1
session.gc_maxlifetime = 1440
session.referer_check =
session.entropy_length = 0
session.entropy_file =
session.cache_limiter = nocache
session.cache_expire = 180

[MSSQL]
mssql.allow_persistent=On
mssql.max_persistent=-1
mssql.max_links=-1
mssql.min_error_severity=10
mssql.min_message_severity=10
mssql.compatability_mode= Off

[Assertion]
------------------------------------------------------
the script (problem is between 'BUG-START' and 'BUG-END' comments)
------------------------------------------------------
<?php

// Paramétrage
$pmmShowError=true;
$pmmLang="fr";
$pmmHost="localhost";
$pmmBase="pmm";
$pmmUser="root";
$pmmPwd="";
$pmmTable="pmm";

function ff_get($strType,$strName,$strLang) {
        global $pmmShowError;
        $qryPmm=mysql_query("SELECT PMMTYPE, PMMCONTENT FROM PMM WHERE PMMTYPE='$strType' AND PMMNAME='$strName' AND PMMLANG IN ('$strLang','xx');");
        if($rawPmm=mysql_fetch_array($qryPmm))
                $strReturn=$rawPmm["PMMTYPE"]=="PHP" ? eval($rawPmm["PMMCONTENT"]) : $rawPmm["PMMCONTENT"];
        else
                switch($strType) {
                        case 'TEXT': $strReturn=$pmmShowError?$strName.($strLang=="fr"?" ":"").": ".ff_error(1,$strLang):"";
                        case 'HTML': $strReturn=$pmmShowError?$strName.($strLang=="fr"?" ":"").": ".ff_error(2,$strLang):"";
                        case 'PHP': $strReturn=$pmmShowError?$strName.($strLang=="fr"?" ":"").": ".ff_error(3,$strLang):"";
                        case 'ERROR': $strReturn="";
                        default: $strReturn=$pmmShowError?$strName.($strLang=="fr"?" ":"").": ".ff_error(4,$strLang):"";
                }
        return $strReturn;
}

function ff_error($lngNumError,$strLang) {
        return ff_get("ERROR", (string)$lngNumError, $strLang);
}

// Connexion à la base de données
mysql_pconnect($pmmHost,$pmmUser,$pmmPwd);
mysql_select_db($pmmBase);

// Paramètres

// BUG-START: The issue begins here
if (isset($lg))
        $strLang=(string)$lg;
else
        $strLang=$pmmLang;
// BUG-END: and ends there

// Cadre de base
$strContent=ff_get("HTML","#BASE#",$strLang);

// Remplissage
while(eregi("{ZONE:([^}]+)}",$strContent) || eregi("{TEXT:([^}]+)}",$strContent) ||
          eregi("{COMP:([^}]+)}",$strContent) || eregi("{NULL:([^}]+)}",$strContent)) {

        // Zones statiques
        if(eregi("{ZONE:([^}]+)}",$strContent,$arrFound))
                $strContent=eregi_replace($arrFound[0],ff_get("HTML",strtoupper($arrFound[1]),$strLang),$strContent);

        // Textes
        if(eregi("{TEXT:([^}]+)}",$strContent,$arrFound))
                $strContent=eregi_replace($arrFound[0],ff_get("TEXT",strtoupper($arrFound[1]),$strLang),$strContent);

        // Listes

        // Champs

        // Zones calculées
        if(eregi("{COMP:([^}]+)}",$strContent,$arrFound))
                $strContent=eregi_replace($arrFound[0],ff_get("PHP",strtoupper($arrFound[1]),$strLang),$strContent);

        // Zones nulles
        if(eregi("{NULL:([^}]+)}",$strContent,$arrFound))
                $strContent=eregi_replace($arrFound[0],ff_get("TEXT","#NULL#",$strLang),$strContent);
}

// Zones inutilisées
if(eregi("{([^}]+)}",$strContent,$arrFound))
        $strContent=eregi_replace($arrFound[0],ff_get("TEXT","#NULL#",$strLang),$strContent);

// Déconnexion de la base de données
mysql_close();

// Affichage
echo $strContent;

?>

---------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online.

Full Bug description available at: http://bugs.php.net/?id=5508

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>