Browse Source

Fixed Bug #43958 (class name added into the error message)

PHP-5.2.1RC1
Dmitry Stogov 18 years ago
parent
commit
bc053b7628
  1. 1
      NEWS
  2. 5
      main/main.c
  3. 17
      tests/lang/bug43958.phpt

1
NEWS

@ -87,6 +87,7 @@ PHP NEWS
(Jani)
- Fixed bug #43993 (mb_substr_count() behaves differently to substr_count() with
overlapping needles). (Moriyoshi)
- Fixed Bug #43958 (class name added into the error message). (Dmitry)
- Fixed bug #43941 (json_encode silently cuts non-UTF8 strings). (Stas)
- Fixed bug #43782 (feof() does not detect timeout on socket). (David Soria Parra)
- Fixed bug #43668 (Added odbc.default_cursortype to control the ODBC

5
main/main.c

@ -568,8 +568,8 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
char *docref_target = "", *docref_root = "";
char *p;
int buffer_len = 0;
char *space;
char *class_name = get_active_class_name(&space TSRMLS_CC);
char *space = "";
char *class_name = "";
char *function;
int origin_len;
char *origin;
@ -625,6 +625,7 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
function = "Unknown";
} else {
is_function = 1;
class_name = get_active_class_name(&space TSRMLS_CC);
}
}

17
tests/lang/bug43958.phpt

@ -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
Loading…
Cancel
Save