@@ -470,7 +470,7 @@ static spl_filesystem_object *spl_filesystem_object_create_info(spl_filesystem_o
470
470
return intern ;
471
471
} /* }}} */
472
472
473
- static spl_filesystem_object * spl_filesystem_object_create_type (int ht , spl_filesystem_object * source , int type , zend_class_entry * ce , zval * return_value ) /* {{{ */
473
+ static spl_filesystem_object * spl_filesystem_object_create_type (int num_args , spl_filesystem_object * source , int type , zend_class_entry * ce , zval * return_value ) /* {{{ */
474
474
{
475
475
spl_filesystem_object * intern ;
476
476
zend_bool use_include_path = 0 ;
@@ -542,7 +542,7 @@ static spl_filesystem_object *spl_filesystem_object_create_type(int ht, spl_file
542
542
intern -> u .file .open_mode = "r" ;
543
543
intern -> u .file .open_mode_len = 1 ;
544
544
545
- if (ht && zend_parse_parameters (ht , "|sbr" ,
545
+ if (num_args && zend_parse_parameters (num_args , "|sbr" ,
546
546
& intern -> u .file .open_mode , & intern -> u .file .open_mode_len ,
547
547
& use_include_path , & intern -> u .file .zcontext ) == FAILURE ) {
548
548
zend_restore_error_handling (& error_handling );
@@ -700,8 +700,6 @@ void spl_filesystem_object_construct(INTERNAL_FUNCTION_PARAMETERS, zend_long cto
700
700
zend_long flags ;
701
701
zend_error_handling error_handling ;
702
702
703
- zend_replace_error_handling (EH_THROW , spl_ce_UnexpectedValueException , & error_handling );
704
-
705
703
if (SPL_HAS_FLAG (ctor_flags , DIT_CTOR_FLAGS )) {
706
704
flags = SPL_FILE_DIR_KEY_AS_PATHNAME |SPL_FILE_DIR_CURRENT_AS_FILEINFO ;
707
705
parsed = zend_parse_parameters (ZEND_NUM_ARGS (), "p|l" , & path , & len , & flags );
@@ -716,23 +714,23 @@ void spl_filesystem_object_construct(INTERNAL_FUNCTION_PARAMETERS, zend_long cto
716
714
flags |= SPL_FILE_DIR_UNIXPATHS ;
717
715
}
718
716
if (parsed == FAILURE ) {
719
- zend_restore_error_handling (& error_handling );
720
717
return ;
721
718
}
719
+
722
720
if (!len ) {
723
721
zend_throw_exception_ex (spl_ce_RuntimeException , 0 , "Directory name must not be empty." );
724
- zend_restore_error_handling (& error_handling );
725
722
return ;
726
723
}
727
724
728
725
intern = Z_SPLFILESYSTEM_P (ZEND_THIS );
729
726
if (intern -> _path ) {
730
727
/* object is already initialized */
731
- zend_restore_error_handling (& error_handling );
732
728
php_error_docref (NULL , E_WARNING , "Directory object is already initialized" );
733
729
return ;
734
730
}
735
731
intern -> flags = flags ;
732
+
733
+ zend_replace_error_handling (EH_THROW , spl_ce_UnexpectedValueException , & error_handling );
736
734
#ifdef HAVE_GLOB
737
735
if (SPL_HAS_FLAG (ctor_flags , DIT_CTOR_GLOB ) && strstr (path , "glob://" ) != path ) {
738
736
spprintf (& path , 0 , "glob://%s" , path );
@@ -1101,7 +1099,6 @@ SPL_METHOD(FilesystemIterator, current)
1101
1099
} else {
1102
1100
ZVAL_OBJ (return_value , Z_OBJ_P (ZEND_THIS ));
1103
1101
Z_ADDREF_P (return_value );
1104
- /*RETURN_STRING(intern->u.dir.entry.d_name, 1);*/
1105
1102
}
1106
1103
}
1107
1104
/* }}} */
0 commit comments