File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,6 @@ ZEND_DECLARE_MODULE_GLOBALS(assert)
34
34
35
35
#define ASSERTG (v ) ZEND_MODULE_GLOBALS_ACCESSOR (assert , v )
36
36
37
- #define SAFE_STRING (s ) ((s )?(s ):"")
38
-
39
37
PHPAPI zend_class_entry * assertion_error_ce ;
40
38
41
39
static PHP_INI_MH (OnChangeCallback ) /* {{{ */
@@ -151,9 +149,12 @@ PHP_FUNCTION(assert)
151
149
zval args [4 ];
152
150
zval retval ;
153
151
uint32_t lineno = zend_get_executed_lineno ();
154
- const char * filename = zend_get_executed_filename ();
152
+ const zend_string * filename = zend_get_executed_filename_ex ();
153
+ if (UNEXPECTED (!filename )) {
154
+ filename = ZSTR_KNOWN (ZEND_STR_UNKNOWN_CAPITALIZED );
155
+ }
155
156
156
- ZVAL_STRING (& args [0 ], SAFE_STRING ( filename ) );
157
+ ZVAL_STR (& args [0 ], filename );
157
158
ZVAL_LONG (& args [1 ], lineno );
158
159
ZVAL_NULL (& args [2 ]);
159
160
You can’t perform that action at this time.
0 commit comments