cvs: php4(PHP_4_2_0) /ext/standard basic_functions.c
| From: | Rasmus Lerdorf | Date: | Sat, 11 May 2002 18:50:34 +0000 |
| Subject: | cvs: php4(PHP_4_2_0) /ext/standard basic_functions.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-11848@lists.php.net to get a copy of this message | ||
rasmus Sat May 11 14:50:34 2002 EDT
Modified files: (Branch: PHP_4_2_0)
/php4/ext/standard basic_functions.c
Log:
MFH - safe-mode show_source() fix
Index: php4/ext/standard/basic_functions.c
diff -u php4/ext/standard/basic_functions.c:1.447.2.2 php4/ext/standard/basic_functions.c:1.447.2.3
--- php4/ext/standard/basic_functions.c:1.447.2.2 Thu Apr 11 08:53:19 2002
+++ php4/ext/standard/basic_functions.c Sat May 11 14:50:28 2002
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.447.2.2 2002/04/11 12:53:19 derick Exp $ */
+/* $Id: basic_functions.c,v 1.447.2.3 2002/05/11 18:50:28 rasmus Exp $ */
#include "php.h"
#include "php_main.h"
@@ -1888,6 +1888,14 @@
return;
}
convert_to_string(filename);
+
+ if (PG(safe_mode) && (!php_checkuid(Z_STRVAL_P(filename), NULL,
CHECKUID_ALLOW_ONLY_FILE))) {
+ RETURN_FALSE;
+ }
+
+ if (php_check_open_basedir(Z_STRVAL_P(filename) TSRMLS_CC)) {
+ RETURN_FALSE;
+ }
if (i) {
php_start_ob_buffer (NULL, 0, 1 TSRMLS_CC);