function FileSecurity::denyPublicAccess
Same name in this branch
- 9 core/lib/Drupal/Component/FileSecurity/FileSecurity.php \Drupal\Component\FileSecurity\FileSecurity::denyPublicAccess()
Same name in other branches
- 8.9.x composer/Plugin/VendorHardening/FileSecurity.php \Drupal\Composer\Plugin\VendorHardening\FileSecurity::denyPublicAccess()
- 8.9.x core/lib/Drupal/Component/FileSecurity/FileSecurity.php \Drupal\Component\FileSecurity\FileSecurity::denyPublicAccess()
- 10 composer/Plugin/VendorHardening/FileSecurity.php \Drupal\Composer\Plugin\VendorHardening\FileSecurity::denyPublicAccess()
- 10 core/lib/Drupal/Component/FileSecurity/FileSecurity.php \Drupal\Component\FileSecurity\FileSecurity::denyPublicAccess()
- 11.x composer/Plugin/VendorHardening/FileSecurity.php \Drupal\Composer\Plugin\VendorHardening\FileSecurity::denyPublicAccess()
- 11.x core/lib/Drupal/Component/FileSecurity/FileSecurity.php \Drupal\Component\FileSecurity\FileSecurity::denyPublicAccess()
Returns htaccess directives to block all access to a given directory.
Return value
string Apache htaccess directives to block access to a location.
1 call to FileSecurity::denyPublicAccess()
- FileSecurity::htaccessLines in composer/
Plugin/ VendorHardening/ FileSecurity.php - Returns the standard .htaccess lines that Drupal writes.
File
-
composer/
Plugin/ VendorHardening/ FileSecurity.php, line 92
Class
- FileSecurity
- Provides file security functions.
Namespace
Drupal\Composer\Plugin\VendorHardeningCode
protected static function denyPublicAccess() {
return <<<EOF
# Deny all requests from Apache 2.4+.
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
# Deny all requests from Apache 2.0-2.2.
<IfModule !mod_authz_core.c>
Deny from all
</IfModule>
EOF;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.