summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2007-06-18 22:01:56 +0000
committerStanislav Malyshev <stas@php.net>2007-06-18 22:01:56 +0000
commita5b3ddd83084bc66d0bd0653ee609d4032f6405c (patch)
tree74e3f005dfab730fee3dc524b23063d4574f8cda
parent166366a763d6a2a74f418a750ad3b0d92fc8407e (diff)
downloadphp-git-a5b3ddd83084bc66d0bd0653ee609d4032f6405c.tar.gz
Fix INFILE LOCAL option handling with MySQL - now not allowed when safe_mode
is active
-rw-r--r--ext/mysql/php_mysql.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c
index 288de3133d..1d265bd61e 100644
--- a/ext/mysql/php_mysql.c
+++ b/ext/mysql/php_mysql.c
@@ -595,8 +595,8 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
WRONG_PARAM_COUNT;
break;
}
- /* disable local infile option for open_basedir */
- if (PG(open_basedir) && strlen(PG(open_basedir)) && (client_flags & CLIENT_LOCAL_FILES)) {
+ /* disable local infile option for open_basedir and safe_mode */
+ if (((PG(open_basedir) && PG(open_basedir)[0] != '\0') || PG(safe_mode)) && (client_flags & CLIENT_LOCAL_FILES)) {
client_flags ^= CLIENT_LOCAL_FILES;
}