|
@@ -282,21 +282,22 @@ class Text {
|
282
|
282
|
}
|
283
|
283
|
$Host = $URLInfo['host'];
|
284
|
284
|
// If for some reason your site does not require subdomains or contains a directory in the SITE_DOMAIN, revert to the line below.
|
285
|
|
- //if ($Host == SITE_DOMAIN || $Host == 'www.'.SITE_DOMAIN) {
|
286
|
|
- if (empty($URLInfo['port']) && preg_match('/(\S+\.)*'.SITE_DOMAIN.'/', $Host)) {
|
287
|
|
- $URL = '';
|
288
|
|
- if (!empty($URLInfo['path'])) {
|
289
|
|
- $URL .= ltrim($URLInfo['path'], '/'); // Things break if the path starts with '//'
|
290
|
|
- }
|
291
|
|
- if (!empty($URLInfo['query'])) {
|
292
|
|
- $URL .= "?$URLInfo[query]";
|
293
|
|
- }
|
294
|
|
- if (!empty($URLInfo['fragment'])) {
|
295
|
|
- $URL .= "#$URLInfo[fragment]";
|
|
285
|
+ if ($Host == SITE_DOMAIN || $Host == 'www.'.SITE_DOMAIN) {
|
|
286
|
+ if (empty($URLInfo['port']) && preg_match('/(\S+\.)*'.SITE_DOMAIN.'/', $Host)) {
|
|
287
|
+ $URL = '';
|
|
288
|
+ if (!empty($URLInfo['path'])) {
|
|
289
|
+ $URL .= ltrim($URLInfo['path'], '/'); // Things break if the path starts with '//'
|
|
290
|
+ }
|
|
291
|
+ if (!empty($URLInfo['query'])) {
|
|
292
|
+ $URL .= "?$URLInfo[query]";
|
|
293
|
+ }
|
|
294
|
+ if (!empty($URLInfo['fragment'])) {
|
|
295
|
+ $URL .= "#$URLInfo[fragment]";
|
|
296
|
+ }
|
|
297
|
+ return $URL ? "/$URL" : false;
|
|
298
|
+ } else {
|
|
299
|
+ return false;
|
296
|
300
|
}
|
297
|
|
- return $URL ? "/$URL" : false;
|
298
|
|
- } else {
|
299
|
|
- return false;
|
300
|
301
|
}
|
301
|
302
|
|
302
|
303
|
}
|