Skip to content

armgit / Vvveb

Public Imported from GitHub
0

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

Fix default routes init when adding a route from a plugin

givanz1fea023ce078
diff --git a/system/routes.php b/system/routes.php
index 85a32b1..3611252 100755
--- a/system/routes.php
+++ b/system/routes.php
@@ -41,6 +41,8 @@ class Routes {
private static $modules = null;
+ private static $init = false;
+
private static function processRoute($url, $data) {
$module = $data['module'];
//self :: $modules[$module] = $url;
@@ -108,11 +110,12 @@ class Routes {
self :: processRoute($url, $data);
}
+ self :: $init = true;
return true;
}
public static function match($url) {
- if (! self :: $routes) {
+ if (! self :: $init) {
self :: init();
}
@@ -150,7 +153,7 @@ class Routes {
}
public static function getRouteData($module) {
- if (! self :: $routes) {
+ if (! self :: $init) {
self :: init();
}
@@ -177,7 +180,7 @@ class Routes {
}
public static function url($route, $parameters = false) {
- if (! self :: $routes) {
+ if (! self :: $init) {
self :: init();
}