php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34043 GLOBALS fails in encoded code
Submitted: 2005-08-08 22:49 UTC Modified: 2005-08-08 22:56 UTC
From: dstarr at allofe dot net Assigned:
Status: Not a bug Package: Variables related
PHP Version: 5.0.4 OS: Windows Server 2003
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dstarr at allofe dot net
New email:
PHP Version: OS:

 

 [2005-08-08 22:49 UTC] dstarr at allofe dot net
Description:
------------
Versions:
Encoder: ZendSafeGuard-3[1].1.0e-Linux_glibc21-i386
Optimizer: ZendOptimizer-2.5.7-Windows-i386
PHP: php-5.0.4-Win32
Windows: Microsoft Windows Server 2003 SE Service Pack 1
IIS: Version 6.0

Cannot call a member function on an object that is in an array in the GLOBALS.

Reproduce code:
---------------
The code un-encoded works, but once it is encoded it stops working.

function display_loading_popup($msg, $keep_open) {
print_r($GLOBALS);
	$msg_id = $GLOBALS["MESSAGE_API"][1]->displayPopup($msg, MESSAGE_API_PATH, $keep_open);
exit;
	flush();
	return $msg_id;
}
display_loading_popup("Test", 0);

Expected result:
----------------
Array
(
    [GLOBALS] => Array
 *RECURSION*
    [_ENV] => Array
        (
            [OS] => Windows_NT
            [PROCESSOR_ARCHITECTURE] => x86
            [PROCESSOR_IDENTIFIER] => x86 Family 15 Model 4 Stepping 1, GenuineIntel
            [PROCESSOR_LEVEL] => 15
            [PROCESSOR_REVISION] => 0401
            [CONTENT_TYPE] => application/x-www-form-urlencoded
            [GATEWAY_INTERFACE] => CGI/1.1
        )

    [MESSAGE_API] => Array
        (
            [0] => messageapi Object
                (
                    [id] => 0
                    [message] => {0}
                    [search] => Array
                        (
                            [0] => /\{0\}/
                        )

                    [replace] => Array
                        (
                            [0] => Empty Message
                        )

                    [title] => Message
                    [imagePath] => ./
                )

            [1] => loadingmessage Object
                (
                    [id] => 1
                    [message] => {0}
                    [search] => Array
                        (
                            [0] => /\{0\}/
                        )

                    [replace] => Array
                        (
                            [0] => Loading...
                        )

                    [title] => Loading
                    [imagePath] => ./
                )

            [2] => errormessage Object
                (
                    [id] => 2
                    [message] => {0} had an error.
                    [search] => Array
                        (
                            [0] => /\{0\}/
                        )

                    [replace] => Array
                        (
                            [0] => An unknown item
                        )

                    [title] => Error
                    [imagePath] => ./
                )

            [3] => messageapi Object
                (
                    [id] => 4
                    [message] => <table width=100% border=0 cellspacing=0 cellpadding=0><tr><td nowrap>This is a test of a long error message.</td></tr><tr><td nowrap>Apparently there has been a mix up in the database.</td></tr><tr><td nowrap>All your personal information that we promised to keep secret has been mailed to all the other users for some unknown reason.</td></tr></table>
                    [search] => Array
                        (
                        )

                    [replace] => Array
                        (
                        )

                    [title] => Message
                    [imagePath] => ./
                )

        )

)
		<div id="message42f7c4240790d" style="visibility:show; z-index:100; left:350px; top:100px; position:absolute;"><table class='messageapi-outer-table' border='0' cellpadding='0' cellspacing='0' width='100'><tr><td><table class='messageapi-border-table' border='2' cellpadding='0' cellspacing='0' width='100%'><tr><td width='100%'><table class='messageapi-inner-table' border='0' cellpadding='2' cellspacing='0' width='100%'><tr><td id='message42f7c4240790d-drag-bar' bgcolor='#0000cc' align='left' colspan='3'><a class='messageapi-title' href="#" onclick="ns4_start_move('message42f7c4240790d')">Loading</a></td></tr><tr><td colspan='3' width='100%' valign='middle' bgcolor='#dddddd' class='messageapi-message'><br><table width=100% cellspacing=0 cellpadding=0><tr><td nowrap class='loading-message'>Logging In.<BR>Please Wait.</td></tr></table><br>&nbsp;<br></td></tr></table></td></tr></table></td></tr></table></div>
		

Actual result:
--------------
Array
(
    [GLOBALS] => Array
 *RECURSION*
    [_ENV] => Array
        (
            [OS] => Windows_NT
            [PROCESSOR_ARCHITECTURE] => x86
            [PROCESSOR_IDENTIFIER] => x86 Family 15 Model 4 Stepping 1, GenuineIntel
            [PROCESSOR_LEVEL] => 15
            [PROCESSOR_REVISION] => 0401
            [GATEWAY_INTERFACE] => CGI/1.1
            [REQUEST_METHOD] => POST
        )



    [MESSAGE_API] => Array
        (
            [0] => messageapi Object
                (
                    [id] => 0
                    [message] => {0}
                    [search] => Array
                        (
                            [0] => /\{0\}/
                        )

                    [replace] => Array
                        (
                            [0] => Empty Message
                        )

                    [title] => Message
                    [imagePath] => ./
                )

            [1] => loadingmessage Object
                (
                    [id] => 1
                    [message] => {0}
                    [search] => Array
                        (
                            [0] => /\{0\}/
                        )

                    [replace] => Array
                        (
                            [0] => Loading...
                        )

                    [title] => Loading
                    [imagePath] => ./
                )

            [2] => errormessage Object
                (
                    [id] => 2
                    [message] => {0} had an error.
                    [search] => Array
                        (
                            [0] => /\{0\}/
                        )

                    [replace] => Array
                        (
                            [0] => An unknown item
                        )

                    [title] => Error
                    [imagePath] => ./
                )

            [3] => messageapi Object
                (
                    [id] => 4
                    [message] => <table width=100% border=0 cellspacing=0 cellpadding=0><tr><td nowrap>This is a test of a long error message.</td></tr><tr><td nowrap>Apparently there has been a mix up in the database.</td></tr><tr><td nowrap>All your personal information that we promised to keep secret has been mailed to all the other users for some unknown reason.</td></tr></table>
                    [search] => Array
                        (
                        )

                    [replace] => Array
                        (
                        )

                    [title] => Message
                    [imagePath] => ./
                )

        )
)
<br />
<b>Fatal error</b>:  Call to a member function displaypopup() on a non-object in <b>c:\Inetpub\wwwroot\sped\common\messageapi\MessageAPI_functions.php</b> on line <b>25</b><br />


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-08 22:56 UTC] derick@php.net
Do not file bugs when you have Zend extensions (zend_extension=)
loaded. Examples are Zend Optimizer, Zend Debugger, Turck MM Cache,
APC, Xdebug and ionCube loader.  These extensions often modify engine
behavior which is not related to PHP itself.

Definitely the wrong place to report bugs in Zend products here.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 01 05:01:29 2024 UTC