dmitry          Tue Sep  2 09:46:00 2008 UTC

  Modified files:              
    /php-src/main       main.c 
    /php-src/tests/lang bug43958.phpt 
  Log:
  Fixed Bug #43958 (class name added into the error message)
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.783&r2=1.784&diff_format=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.783 php-src/main/main.c:1.784
--- php-src/main/main.c:1.783   Tue Aug 26 23:25:40 2008
+++ php-src/main/main.c Tue Sep  2 09:46:00 2008
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: main.c,v 1.783 2008/08/26 23:25:40 jani Exp $ */
+/* $Id: main.c,v 1.784 2008/09/02 09:46:00 dmitry Exp $ */
 
 /* {{{ includes
  */
@@ -668,8 +668,8 @@
        char *docref_target = "", *docref_root = "";
        char *p;
        int buffer_len = 0;
-       char *space;
-       zstr class_name = get_active_class_name(&space TSRMLS_CC);
+       char *space = "";
+       zstr class_name = EMPTY_ZSTR;
        int origin_len;
        zstr function = NULL_ZSTR;
        char *origin;
@@ -721,6 +721,8 @@
                if (!function.v || !USTR_LEN(function)) {
                        stage = "Unknown";
                        function.v = NULL;
+               } else {
+                       class_name = get_active_class_name(&space TSRMLS_CC);
                }
        }
 
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/bug43958.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/bug43958.phpt
diff -u /dev/null php-src/tests/lang/bug43958.phpt:1.2
--- /dev/null   Tue Sep  2 09:46:00 2008
+++ php-src/tests/lang/bug43958.phpt    Tue Sep  2 09:46:00 2008
@@ -0,0 +1,17 @@
+--TEST--
+Bug #43958 (class name added into the error message)
+--FILE--
+<?php
+class MyClass
+{
+       static public function loadCode($p) {
+               return include $p;
+       }
+}
+
+MyClass::loadCode('file-which-does-not-exist-on-purpose.php');
+--EXPECTF--
+Warning: include(file-which-does-not-exist-on-purpose.php): failed to open 
stream: No such file or directory in %sbug43958.php on line 5
+
+Warning: include(): Failed opening 'file-which-does-not-exist-on-purpose.php' 
for inclusion (include_path='%s') in %sbug43958.php on line 5
+



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to