Skip to content
Snippets Groups Projects
Verified Commit de1a11ea authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2463967 by Darren Oh, tunic, andypost, alexpott, quietone, mstrelan,...

Issue #2463967 by Darren Oh, tunic, andypost, alexpott, quietone, mstrelan, longwave: Add PHP settings to .user.ini
parent ed5d89dc
No related branches found
No related tags found
No related merge requests found
# #
# Apache/PHP/Drupal settings: # Apache/mod_php/Drupal settings:
# #
# Protect files and directories from prying eyes. # Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|web\.config|yarn\.lock|package\.json)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$"> <FilesMatch "\.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|web\.config|yarn\.lock|package\.json|\.user\.ini)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$">
<IfModule mod_authz_core.c> <IfModule mod_authz_core.c>
Require all denied Require all denied
</IfModule> </IfModule>
...@@ -24,8 +24,11 @@ AddEncoding gzip svgz ...@@ -24,8 +24,11 @@ AddEncoding gzip svgz
# Most of the following PHP settings cannot be changed at runtime. See # Most of the following PHP settings cannot be changed at runtime. See
# sites/default/default.settings.php and # sites/default/default.settings.php and
# Drupal\Core\DrupalKernel::bootEnvironment() for settings that can be # Drupal\Core\DrupalKernel::bootEnvironment() for settings that can be changed
# changed at runtime. # at runtime.
#
# PHP only reads settings from this file if it is running as an Apache module.
# If PHP is running as a CGI script, see .user.ini.
<IfModule mod_php.c> <IfModule mod_php.c>
php_value assert.active 0 php_value assert.active 0
</IfModule> </IfModule>
......
; Most of the following PHP settings cannot be changed at runtime. See
; sites/default/default.settings.php and
; Drupal\Core\DrupalKernel::bootEnvironment() for settings that can be changed
; at runtime.
;
; PHP only reads settings from this file if it is running as a CGI script. If
; PHP is running as an Apache module, see .htaccess.
; Disable PHP assertions.
assert.active = 0
...@@ -495,7 +495,7 @@ ...@@ -495,7 +495,7 @@
"dist": { "dist": {
"type": "path", "type": "path",
"url": "core", "url": "core",
"reference": "cc2af7de02a19bfde449293a84468f5fb1e33cea" "reference": "436f1c4b149b110c60db014909edf6ff2e6fc9f9"
}, },
"require": { "require": {
"asm89/stack-cors": "^2.1", "asm89/stack-cors": "^2.1",
...@@ -585,6 +585,7 @@ ...@@ -585,6 +585,7 @@
"[web-root]/.eslintrc.json": "assets/scaffold/files/eslintrc.json", "[web-root]/.eslintrc.json": "assets/scaffold/files/eslintrc.json",
"[web-root]/.ht.router.php": "assets/scaffold/files/ht.router.php", "[web-root]/.ht.router.php": "assets/scaffold/files/ht.router.php",
"[web-root]/.htaccess": "assets/scaffold/files/htaccess", "[web-root]/.htaccess": "assets/scaffold/files/htaccess",
"[web-root]/.user.ini": "assets/scaffold/files/user.ini",
"[web-root]/example.gitignore": "assets/scaffold/files/example.gitignore", "[web-root]/example.gitignore": "assets/scaffold/files/example.gitignore",
"[web-root]/index.php": "assets/scaffold/files/index.php", "[web-root]/index.php": "assets/scaffold/files/index.php",
"[web-root]/INSTALL.txt": "assets/scaffold/files/drupal.INSTALL.txt", "[web-root]/INSTALL.txt": "assets/scaffold/files/drupal.INSTALL.txt",
......
# #
# Apache/PHP/Drupal settings: # Apache/mod_php/Drupal settings:
# #
# Protect files and directories from prying eyes. # Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|web\.config|yarn\.lock|package\.json)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$"> <FilesMatch "\.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|web\.config|yarn\.lock|package\.json|\.user\.ini)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$">
<IfModule mod_authz_core.c> <IfModule mod_authz_core.c>
Require all denied Require all denied
</IfModule> </IfModule>
...@@ -24,8 +24,11 @@ AddEncoding gzip svgz ...@@ -24,8 +24,11 @@ AddEncoding gzip svgz
# Most of the following PHP settings cannot be changed at runtime. See # Most of the following PHP settings cannot be changed at runtime. See
# sites/default/default.settings.php and # sites/default/default.settings.php and
# Drupal\Core\DrupalKernel::bootEnvironment() for settings that can be # Drupal\Core\DrupalKernel::bootEnvironment() for settings that can be changed
# changed at runtime. # at runtime.
#
# PHP only reads settings from this file if it is running as an Apache module.
# If PHP is running as a CGI script, see .user.ini.
<IfModule mod_php.c> <IfModule mod_php.c>
php_value assert.active 0 php_value assert.active 0
</IfModule> </IfModule>
......
; Most of the following PHP settings cannot be changed at runtime. See
; sites/default/default.settings.php and
; Drupal\Core\DrupalKernel::bootEnvironment() for settings that can be changed
; at runtime.
;
; PHP only reads settings from this file if it is running as a CGI script. If
; PHP is running as an Apache module, see .htaccess.
; Disable PHP assertions.
assert.active = 0
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<rewrite> <rewrite>
<rules> <rules>
<rule name="Protect files and directories from prying eyes" stopProcessing="true"> <rule name="Protect files and directories from prying eyes" stopProcessing="true">
<match url="\.(engine|inc|install|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format|composer\.(json|lock)|\.htaccess|yarn.lock|package.json)$" /> <match url="\.(engine|inc|install|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format|composer\.(json|lock)|\.htaccess|yarn.lock|package.json|.user.ini)$" />
<action type="CustomResponse" statusCode="403" subStatusCode="0" statusReason="Forbidden" statusDescription="Access is forbidden." /> <action type="CustomResponse" statusCode="403" subStatusCode="0" statusReason="Forbidden" statusDescription="Access is forbidden." />
</rule> </rule>
......
...@@ -127,6 +127,7 @@ ...@@ -127,6 +127,7 @@
"[web-root]/.eslintrc.json": "assets/scaffold/files/eslintrc.json", "[web-root]/.eslintrc.json": "assets/scaffold/files/eslintrc.json",
"[web-root]/.ht.router.php": "assets/scaffold/files/ht.router.php", "[web-root]/.ht.router.php": "assets/scaffold/files/ht.router.php",
"[web-root]/.htaccess": "assets/scaffold/files/htaccess", "[web-root]/.htaccess": "assets/scaffold/files/htaccess",
"[web-root]/.user.ini": "assets/scaffold/files/user.ini",
"[web-root]/example.gitignore": "assets/scaffold/files/example.gitignore", "[web-root]/example.gitignore": "assets/scaffold/files/example.gitignore",
"[web-root]/index.php": "assets/scaffold/files/index.php", "[web-root]/index.php": "assets/scaffold/files/index.php",
"[web-root]/INSTALL.txt": "assets/scaffold/files/drupal.INSTALL.txt", "[web-root]/INSTALL.txt": "assets/scaffold/files/drupal.INSTALL.txt",
......
...@@ -98,6 +98,7 @@ protected function getProtectedFiles() { ...@@ -98,6 +98,7 @@ protected function getProtectedFiles() {
// Ensure web server configuration files cannot be accessed. // Ensure web server configuration files cannot be accessed.
$file_paths["$path/.htaccess"] = 403; $file_paths["$path/.htaccess"] = 403;
$file_paths["$path/web.config"] = 403; $file_paths["$path/web.config"] = 403;
$file_paths["$path/.user.ini"] = 403;
return $file_paths; return $file_paths;
} }
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<rewrite> <rewrite>
<rules> <rules>
<rule name="Protect files and directories from prying eyes" stopProcessing="true"> <rule name="Protect files and directories from prying eyes" stopProcessing="true">
<match url="\.(engine|inc|install|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format|composer\.(json|lock)|\.htaccess|yarn.lock|package.json)$" /> <match url="\.(engine|inc|install|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format|composer\.(json|lock)|\.htaccess|yarn.lock|package.json|.user.ini)$" />
<action type="CustomResponse" statusCode="403" subStatusCode="0" statusReason="Forbidden" statusDescription="Access is forbidden." /> <action type="CustomResponse" statusCode="403" subStatusCode="0" statusReason="Forbidden" statusDescription="Access is forbidden." />
</rule> </rule>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment