Welcome to black pen

Here you can insert your own content and your own images. Simply click on the small pencil right above this text. You can delete or change this text - it's only an example.

# Fixes glob to return empty arrays on nonexisting and nonallowed patterns # instead of false, when using open_basedir. # # Working on PHP 5.2.8 --- ext/standard/dir.c.orig 2008-08-12 01:16:40.000000000 +0200 +++ ext/standard/dir.c 2009-02-11 08:57:24.000000000 +0100 @@ -473,7 +473,8 @@ can be used for simple glob() calls without further error checking. */ - goto no_results; + array_init(return_value); + return; } #endif RETURN_FALSE; @@ -481,14 +482,6 @@ /* now catch the FreeBSD style of "no matches" */ if (!globbuf.gl_pathc || !globbuf.gl_pathv) { -no_results: - if (PG(safe_mode) || (PG(open_basedir) && *PG(open_basedir))) { - struct stat s; - - if (0 != VCWD_STAT(pattern, &s) || S_IFDIR != (s.st_mode & S_IFMT)) { - RETURN_FALSE; - } - } array_init(return_value); return; } @@ -530,7 +523,8 @@ if (basedir_limit && !zend_hash_num_elements(Z_ARRVAL_P(return_value))) { zval_dtor(return_value); - RETURN_FALSE; + array_init(return_value); + return; } } /* }}} */ # Fixes glob to return empty arrays on nonexisting and nonallowed patterns # instead of false, when using open_basedir. # # Working on PHP 5.2.8 --- ext/standard/dir.c.orig 2008-08-12 01:16:40.000000000 +0200 +++ ext/standard/dir.c 2009-02-11 08:57:24.000000000 +0100 @@ -473,7 +473,8 @@ can be used for simple glob() calls without further error checking. */ - goto no_results; + array_init(return_value); + return; } #endif RETURN_FALSE; @@ -481,14 +482,6 @@ /* now catch the FreeBSD style of "no matches" */ if (!globbuf.gl_pathc || !globbuf.gl_pathv) { -no_results: - if (PG(safe_mode) || (PG(open_basedir) && *PG(open_basedir))) { - struct stat s; - - if (0 != VCWD_STAT(pattern, &s) || S_IFDIR != (s.st_mode & S_IFMT)) { - RETURN_FALSE; - } - } array_init(return_value); return; } @@ -530,7 +523,8 @@ if (basedir_limit && !zend_hash_num_elements(Z_ARRVAL_P(return_value))) { zval_dtor(return_value); - RETURN_FALSE; + array_init(return_value); + return; } } /* }}} */
# Fixes glob to return empty arrays on nonexisting and nonallowed patterns
# instead of false, when using open_basedir.
#
# Working on PHP 5.2.8
--- ext/standard/dir.c.orig     2008-08-12 01:16:40.000000000 +0200
+++ ext/standard/dir.c  2009-02-11 08:57:24.000000000 +0100
@@ -473,7 +473,8 @@
                           can be used for simple glob() calls without further error
                           checking.
                        */
-                       goto no_results;
+                       array_init(return_value);
+                       return;
                }
 #endif
                RETURN_FALSE;
@@ -481,14 +482,6 @@

        /* now catch the FreeBSD style of "no matches" */
        if (!globbuf.gl_pathc || !globbuf.gl_pathv) {
-no_results:
-               if (PG(safe_mode) || (PG(open_basedir) && *PG(open_basedir))) {
-                       struct stat s;
-
-                       if (0 != VCWD_STAT(pattern, &s) || S_IFDIR != (s.st_mode & S_IFMT)) {
-                               RETURN_FALSE;
-                       }
-               }
                array_init(return_value);
                return;
        }
@@ -530,7 +523,8 @@

        if (basedir_limit && !zend_hash_num_elements(Z_ARRVAL_P(return_value))) {
                zval_dtor(return_value);
-               RETURN_FALSE;
+               array_init(return_value);
+               return;
        }
 }
 /* }}} */

Recent Images
My Account



No videos found.

Recent Posts

No posts could be found.