aboutsummaryrefslogtreecommitdiffstats
path: root/config/apache_mod_security
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2009-06-25 12:13:52 -0400
committerScott Ullrich <sullrich@pfsense.org>2009-06-25 12:13:52 -0400
commit011386d8a134375c8349086272e82498f7796a6c (patch)
tree685a7778ab6986906d318ee6014b6ea21075118f /config/apache_mod_security
parent3da206a823e436f3a3ad5d44aa6daa7929bb6d6a (diff)
downloadpfsense-packages-011386d8a134375c8349086272e82498f7796a6c.tar.gz
pfsense-packages-011386d8a134375c8349086272e82498f7796a6c.tar.bz2
pfsense-packages-011386d8a134375c8349086272e82498f7796a6c.zip
Ensure leading http(s):// and trailing / on additional hostnames
Diffstat (limited to 'config/apache_mod_security')
-rw-r--r--config/apache_mod_security/apache_mod_security.inc12
1 files changed, 10 insertions, 2 deletions
diff --git a/config/apache_mod_security/apache_mod_security.inc b/config/apache_mod_security/apache_mod_security.inc
index 15550dd3..107e8b4f 100644
--- a/config/apache_mod_security/apache_mod_security.inc
+++ b/config/apache_mod_security/apache_mod_security.inc
@@ -218,8 +218,16 @@ EOF;
if($config['installedpackages']['apachemodsecurity']) {
foreach($config['installedpackages']['apachemodsecurity']['config'] as $ams) {
// Set rowhelper used variables
- foreach($ams['row'] as $row)
- $additionalsitehostnames .= "{$row['additionalsitehostnames']} ";
+ foreach($ams['row'] as $row) {
+ if(!strstr($row['additionalsitehostnames'], "http"))
+ $additionalsitehostnames .= "http://";
+ $additionalsitehostnames .= "{$row['additionalsitehostnames']}";
+ // Ensure trailing /
+ if(substr($row['additionalsitehostnames'],count($row['additionalsitehostnames']),1) != "/")
+ $additionalsitehostnames .= "/ ";
+ else
+ $additionalsitehostnames .= " ";
+ }
$backend_sites = ""; // not technically needed. added for readability due to .='s
foreach($ams['row'] as $row) {
// Ensure leading http(s)://