]> granicus.if.org Git - php/commitdiff
fix mail.log openbasedir interaction with .htaccess
authorStanislav Malyshev <stas@php.net>
Thu, 9 Jul 2009 00:24:26 +0000 (00:24 +0000)
committerStanislav Malyshev <stas@php.net>
Thu, 9 Jul 2009 00:24:26 +0000 (00:24 +0000)
main/main.c

index f47a087fb20501dd427f25acbcc878ae7aba3297..7617756150a8fe76be77926441b2223191f78932 100644 (file)
@@ -480,6 +480,23 @@ static PHP_INI_MH(OnUpdateErrorLog)
 }
 /* }}} */
 
+/* {{{ PHP_INI_MH
+ */
+static PHP_INI_MH(OnUpdateMailLog)
+{
+       /* Only do the safemode/open_basedir check at runtime */
+       if (stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) {
+               if (PG(open_basedir) && php_check_open_basedir(new_value TSRMLS_CC)) {
+                       return FAILURE;
+               }
+
+       }
+       OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+       return SUCCESS;
+}
+/* }}} */
+
+
 /* {{{ PHP_INI_MH
  */
 static PHP_INI_MH(OnChangeMailForceExtra)
@@ -579,7 +596,7 @@ PHP_INI_BEGIN()
        PHP_INI_ENTRY("SMTP",                                           "localhost",PHP_INI_ALL,                NULL)
        PHP_INI_ENTRY("smtp_port",                                      "25",           PHP_INI_ALL,            NULL)
        STD_PHP_INI_BOOLEAN("mail.add_x_header",                        "0",            PHP_INI_SYSTEM|PHP_INI_PERDIR,          OnUpdateBool,                   mail_x_header,                  php_core_globals,       core_globals)
-       STD_PHP_INI_ENTRY("mail.log",                                   NULL,           PHP_INI_SYSTEM|PHP_INI_PERDIR,          OnUpdateString,                 mail_log,                       php_core_globals,       core_globals)
+       STD_PHP_INI_ENTRY("mail.log",                                   NULL,           PHP_INI_SYSTEM|PHP_INI_PERDIR,          OnUpdateMailLog,                        mail_log,                       php_core_globals,       core_globals)
        PHP_INI_ENTRY("browscap",                                       NULL,           PHP_INI_SYSTEM,         NULL)
        PHP_INI_ENTRY("memory_limit",                           "128M",         PHP_INI_ALL,            OnChangeMemoryLimit)
        PHP_INI_ENTRY("precision",                                      "14",           PHP_INI_ALL,            OnSetPrecision)