]> granicus.if.org Git - php/commitdiff
Remove sql.safe_mode
authorKalle Sommer Nielsen <kalle@php.net>
Thu, 11 Aug 2016 03:06:55 +0000 (05:06 +0200)
committerKalle Sommer Nielsen <kalle@php.net>
Thu, 11 Aug 2016 03:06:55 +0000 (05:06 +0200)
This is one of the last old and odd deprecated settings we still have in PHP, it was never fully implemented in all the database extensions and should probably have been gone back in 5.4, along with safe_mode. Although if my memory strikes me right, mysql was also supporting it back then, but not mysqli.

So far only interbase was supporting this feature, and the removal of it causes two effects for interbase:
 - CREATE DATABASE is now allowed no matter
 - The default database set by php.ini (ibase.default_db) is no longer forced

http://php.net/ini.core#ini.sql.safe-mode

NEWS
UPGRADING
ext/interbase/ibase_query.c
ext/interbase/interbase.c
main/main.c
main/php_globals.h
php.ini-development
php.ini-production

diff --git a/NEWS b/NEWS
index e8c5a69896107f062debf37a30998e964dc59807..a91137ea8d469bd0a59acb7837ccd5c498d2bf06 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ PHP                                                                        NEWS
 ?? ??? 2016, PHP 7.2.0alpha1
 
 - Core:
+  . Removed the sql.safe_mode directive. (Kalle)
   . Fixed bug #54535 (WSA cleanup executes before MSHUTDOWN). (Kalle)
 
 - EXIF:
index b99826d7f88d27b636852225bf196518954f03aa..9c53398ec38705eb2ea730c2258b0f6739df3ea3 100644 (file)
--- a/UPGRADING
+++ b/UPGRADING
@@ -316,6 +316,9 @@ PHP 7.1 UPGRADE NOTES
   . If the value is set to -1, then the dtoa mode 0 is used. No changes
     in default value which is still 14.
 
+- sql.safe_mode
+  . This INI directive have been removed.
+
 ========================================
 12. Windows Support
 ========================================
index 37e59dd3a706ccf73fcea37a13ab70f1fcc24f73..77de9f77e4921bcdbfe790962a0760179ecc82ae 100644 (file)
@@ -1109,10 +1109,6 @@ PHP_FUNCTION(ibase_query)
                                isc_db_handle db = 0;
                                isc_tr_handle trans = 0;
 
-                               if (PG(sql_safe_mode)) {
-                                       _php_ibase_module_error("CREATE DATABASE is not allowed in SQL safe mode"
-                                               );
-
                                } else if (((l = INI_INT("ibase.max_links")) != -1) && (IBG(num_links) >= l)) {
                                        _php_ibase_module_error("CREATE DATABASE is not allowed: maximum link count "
                                                "(" ZEND_LONG_FMT ") reached", l);
index 531019b84181d6f766234e4a1f465ba2e16aa1e1..a4e51c27a6ec793f7ac7ff53201d1ebb44711da2 100644 (file)
@@ -902,7 +902,7 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /*
        }
 
        /* restrict to the server/db in the .ini if in safe mode */
-       if ((!len[DB] || PG(sql_safe_mode)) && (c = INI_STR("ibase.default_db"))) {
+       if (!len[DB] && (c = INI_STR("ibase.default_db"))) {
                args[DB] = c;
                len[DB] = strlen(c);
        }
index 248341c11412b7781c6294cee7a0d085d497167e..bb98f27071191568ab29cbcb8f748568fe78cc71 100644 (file)
@@ -546,7 +546,6 @@ PHP_INI_BEGIN()
        STD_PHP_INI_BOOLEAN("register_argc_argv",       "1",            PHP_INI_PERDIR|PHP_INI_SYSTEM,  OnUpdateBool,   register_argc_argv,             php_core_globals,       core_globals)
        STD_PHP_INI_BOOLEAN("auto_globals_jit",         "1",            PHP_INI_PERDIR|PHP_INI_SYSTEM,  OnUpdateBool,   auto_globals_jit,       php_core_globals,       core_globals)
        STD_PHP_INI_BOOLEAN("short_open_tag",   DEFAULT_SHORT_OPEN_TAG, PHP_INI_SYSTEM|PHP_INI_PERDIR,          OnUpdateBool,                   short_tags,                             zend_compiler_globals,  compiler_globals)
-       STD_PHP_INI_BOOLEAN("sql.safe_mode",            "0",            PHP_INI_SYSTEM,         OnUpdateBool,                   sql_safe_mode,                  php_core_globals,       core_globals)
        STD_PHP_INI_BOOLEAN("track_errors",                     "0",            PHP_INI_ALL,            OnUpdateBool,                   track_errors,                   php_core_globals,       core_globals)
 
        STD_PHP_INI_ENTRY("unserialize_callback_func",  NULL,   PHP_INI_ALL,            OnUpdateString,                 unserialize_callback_func,      php_core_globals,       core_globals)
index e50ea2ebfb33ca8502cb3a2e56de953bdfd3d1b9..91bd100f7edb660d5dfc982243fa543d00a0b1ad 100644 (file)
@@ -58,7 +58,6 @@ struct _php_core_globals {
 
        zend_long output_buffering;
 
-       zend_bool sql_safe_mode;
        zend_bool enable_dl;
 
        char *output_handler;
index 34a561851c97e8ac6f37011956522f199030d942..7aa50a21e3228c799e5cddbb74c88925cef43556 100644 (file)
@@ -1045,10 +1045,6 @@ mail.add_x_header = On
 ; Log mail to syslog (Event Log on Windows).
 ;mail.log = syslog
 
-[SQL]
-; http://php.net/sql.safe-mode
-sql.safe_mode = Off
-
 [ODBC]
 ; http://php.net/odbc.default-db
 ;odbc.default_db    =  Not yet implemented
index e95b1cfb70340f89883db9e0c3ea059619734322..224b72959d7a7e93433180f81e58e4ae727f61e3 100644 (file)
@@ -1045,10 +1045,6 @@ mail.add_x_header = On
 ; Log mail to syslog (Event Log on Windows).
 ;mail.log = syslog
 
-[SQL]
-; http://php.net/sql.safe-mode
-sql.safe_mode = Off
-
 [ODBC]
 ; http://php.net/odbc.default-db
 ;odbc.default_db    =  Not yet implemented