summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoao Ventura2007-12-04 17:04:04 (GMT)
committer Joao Ventura2007-12-04 17:04:04 (GMT)
commitbb9fe02dd4a91e153fa28cb83b0540d172e7e296 (patch)
treea79b19e085b520721326fa6b48f5053e3b50c8ae
parent027e755159cddff888ff84c15524d7124ecb2166 (diff)
Minor fix to #192855, use full base_url if it does not include subdirs
-rw-r--r--print.module8
1 files changed, 7 insertions, 1 deletions
diff --git a/print.module b/print.module
index 8bd3fc4..e29ee1c 100644
--- a/print.module
+++ b/print.module
@@ -536,7 +536,13 @@ function print_rewrite_urls($matches) {
$clean_url = (bool)variable_get('clean_url', '0');
if (substr($url, 0, 1) == "/") {
// If it starts with '/' just append it to the server name
- $server = substr($base_url, 0, strpos($base_url, '/', 7));
+ $max = strpos($base_url, '/', 7);
+ if ($max === false) {
+ $server = $base_url;
+ }
+ else {
+ $server = substr($base_url, 0, $max);
+ }
$newurl = $server .'/'. trim(urldecode($url), "/");
}
elseif ((!$clean_url) && (preg_match("/^[index.php]?\?q=.*/i", $url))) {