Powerful and easy to use cms to build websites, blogs or ecommerce stores.
HTML backendblogblog-engineblog-platformbloggingcmscontent-managementcontent-management-systemecommerceecommerce-platformno-codepage-builderphpphp-cmsphp7php8self-hostedshopping-cartweb-applicationwebsite-builder
Fixed wrong url on localhost for menu items links
givanz0b7fbe0c9b56
diff --git a/app/component/menu.php b/app/component/menu.phpindex 3306eca..1b2a037 100755--- a/app/component/menu.php+++ b/app/component/menu.php@@ -29,6 +29,7 @@ use Vvveb\Sql\postSQL;use Vvveb\Sql\productSQL;use Vvveb\System\Component\ComponentBase;use Vvveb\System\Event;+use Vvveb\System\Sites;use function Vvveb\url;class Menu extends ComponentBase {@@ -86,6 +87,10 @@ class Menu extends ComponentBase {$postIds[$category['item_id']] = $category['item_id'];$taxonomyPosts[$category['item_id']][] = $taxonomy_item_id;}++ if ($type == 'link') {+ $category['url'] = Sites::url($category['url'] ?? '');+ }}//get product itemsdiff --git a/system/sites.php b/system/sites.phpindex ca824a2..1d95a8d 100755--- a/system/sites.php+++ b/system/sites.php@@ -169,7 +169,8 @@ class Sites {}//if host is ip number, localhost or does not have tld remove tld and subdomain- if (is_numeric($host_matches['domain'] ?? null) || $hostWp == 'localhost' || (strpos($hostWp, '.') === false)) {+ if (! ($matches['prefix'] || ($matches['tld'] && $matches['tld'] !== '*')) &&+ (is_numeric($host_matches['domain'] ?? null) || $hostWp == 'localhost' || (strpos($hostWp, '.') === false))) {$matches['domain'] = $host;$matches['subdomain'] = $matches['tld'] = $matches['prefix'] = '';}