Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Fixed subdir install url path

givanz8b5af3bf479b
diff --git a/system/routes.php b/system/routes.php
index 3611252..bcb5b09 100755
--- a/system/routes.php
+++ b/system/routes.php
@@ -111,6 +111,7 @@ class Routes {
}
self :: $init = true;
+
return true;
}
@@ -139,6 +140,10 @@ class Routes {
return self :: $routes[$route] ?? [];
}
+ public static function getRoutes() {
+ return self :: $routes ?? [];
+ }
+
public static function varReplace($url, $parameters) {
return preg_replace_callback('/' . self :: stringRegex . '|' . self :: numericRegex . '/',
function ($matches) use ($parameters) {
@@ -228,9 +233,9 @@ class Routes {
}, $pattern);
if ($missing) {
- return (V_SUBDIR_INSTALL ? V_SUBDIR_INSTALL : '') . '/?route=' . $route . '&' . (is_array($parameters) ? http_build_query($parameters) : '');
+ return '/?route=' . $route . '&' . (is_array($parameters) ? http_build_query($parameters) : '');
} else {
- return (V_SUBDIR_INSTALL ? V_SUBDIR_INSTALL : '') . $url;
+ return $url;
}
}
}
diff --git a/system/sites.php b/system/sites.php
index 39d00f1..ca824a2 100755
--- a/system/sites.php
+++ b/system/sites.php
@@ -164,7 +164,8 @@ class Sites {
return $matches['prefix'] .
$subdomain . ($subdomain ? '.' : '') .
$domain . ($tld ? '.' : '') . $tld .
- ($matches['path'] ?? '');
+ ($matches['path'] ?? '') .
+ (V_SUBDIR_INSTALL ? V_SUBDIR_INSTALL : '');
}
//if host is ip number, localhost or does not have tld remove tld and subdomain
@@ -177,7 +178,8 @@ class Sites {
(! empty($matches['subdomain']) ? $matches['subdomain'] . '.' : '') .
($matches['domain'] ?? '') .
(! empty($matches['tld']) ? '.' . $matches['tld'] : '') .
- ($matches['path'] ?? '');
+ ($matches['path'] ?? '') .
+ (V_SUBDIR_INSTALL ? V_SUBDIR_INSTALL : '');
}
return $url;
@@ -238,8 +240,6 @@ class Sites {
} else {
return self :: setSiteDataByKey($site, $name, $value);
}
-
- return false;
}
public static function getHost() {
@@ -254,7 +254,7 @@ class Sites {
}
if (! $site_url) {
- $host =$_SERVER['HTTP_HOST'] ?? 'localhost';
+ $host = $_SERVER['HTTP_HOST'] ?? 'localhost';
}
$host = self :: siteKey($host);