本文整理汇总了PHP中AIOWPSecurity_Utility_Htaccess::return_regularized_url方法的典型用法代码示例。如果您正苦于以下问题:PHP AIOWPSecurity_Utility_Htaccess::return_regularized_url方法的具体用法?PHP AIOWPSecurity_Utility_Htaccess::return_regularized_url怎么用?PHP AIOWPSecurity_Utility_Htaccess::return_regularized_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AIOWPSecurity_Utility_Htaccess
的用法示例。
在下文中一共展示了AIOWPSecurity_Utility_Htaccess::return_regularized_url方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prevent_image_hotlinks
static function prevent_image_hotlinks()
{
global $aio_wp_security;
$rules = '';
if ($aio_wp_security->configs->get_value('aiowps_prevent_hotlinking') == '1') {
$url_string = AIOWPSecurity_Utility_Htaccess::return_regularized_url(AIOWPSEC_WP_URL);
if ($url_string == FALSE) {
$url_string = AIOWPSEC_WP_URL;
}
$rules .= AIOWPSecurity_Utility_Htaccess::$prevent_image_hotlinks_marker_start . PHP_EOL;
//Add feature marker start
$rules .= '<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$' . PHP_EOL;
$rules .= ' RewriteCond %{REQUEST_FILENAME} -f' . PHP_EOL;
$rules .= ' RewriteCond %{REQUEST_FILENAME} \\.(gif|jpe?g?|png)$ [NC]' . PHP_EOL;
$rules .= ' RewriteCond %{HTTP_REFERER} !^' . $url_string . ' [NC]' . PHP_EOL;
$rules .= ' RewriteRule \\.(gif|jpe?g?|png)$ - [F,NC,L]
</IfModule>' . PHP_EOL;
$rules .= AIOWPSecurity_Utility_Htaccess::$prevent_image_hotlinks_marker_end . PHP_EOL;
//Add feature marker end
}
return $rules;
}