summaryrefslogtreecommitdiff
path: root/application/config/config.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2012-06-05 16:25:09 -0700
committerBharat Mediratta <bharat@menalto.com>2012-06-05 16:25:09 -0700
commitaf45d870d8207b08b4eb9408ba9a618185d72075 (patch)
tree7e061fb03648f49ff8010056c59621d33fde719c /application/config/config.php
parent6104e924aa10f75de919f3b68717188b3912b5dc (diff)
rawurlencode the directory path components to avoid breaking the page layout.
Fixes #1880.
Diffstat (limited to 'application/config/config.php')
-rw-r--r--application/config/config.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/application/config/config.php b/application/config/config.php
index d89e7774..4bece9a1 100644
--- a/application/config/config.php
+++ b/application/config/config.php
@@ -37,10 +37,13 @@
* So dirname doesn't work. So we do a tricky workaround where we look up the SCRIPT_FILENAME (in
* this case it'd be "index.php" and we delete from that part onwards. If you work at 1and1 and
* you're reading this, please fix this bug!
+ *
+ * Rawurlencode each of the elements to avoid breaking the page layout.
*/
$config["site_domain"] =
- substr($_SERVER["SCRIPT_NAME"], 0,
- strpos($_SERVER["SCRIPT_NAME"], basename($_SERVER["SCRIPT_FILENAME"])));
+ implode("/", array_map("rawurlencode", explode("/",
+ substr($_SERVER["SCRIPT_NAME"], 0,
+ strpos($_SERVER["SCRIPT_NAME"], basename($_SERVER["SCRIPT_FILENAME"]))))));
/**
* Force a default protocol to be used by the site. If no site_protocol is