Skip to content

armgit / Vvveb

Public Imported from GitHub
0

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

Template list glob path fix

givanz683db7442bbd
diff --git a/system/core/startup.php b/system/core/startup.php
index 47570fb..db4a062 100755
--- a/system/core/startup.php
+++ b/system/core/startup.php
@@ -131,7 +131,6 @@ function autoload($class) {
//if namespace is App change to app dir
if ((substr_compare($relativeClass, 'App\\', 0, 4) == 0)) {
$root = DIR_ROOT . 'app' . DS;
- var_dump($root);
}
//if namespace is Admin change to admin dir
@@ -354,7 +353,7 @@ function start() {
if ($site) {
define('SITE_URL', $site['host']);
- define('SITE_ID', $site['id']);
+ define('SITE_ID', $site['id'] ?? 1);
//load plugins first for APP
if (APP == 'app') {
diff --git a/system/functions.php b/system/functions.php
index 2ec223a..12fbbf3 100755
--- a/system/functions.php
+++ b/system/functions.php
@@ -916,7 +916,7 @@ function getTemplateList($theme = null, $skip = []) {
$themeFolder = DIR_THEMES . $theme;
//$files = glob("$themeFolder/{,*/*/,*/}*.html", GLOB_BRACE);
$glob = ['', '*/*/', '*/'];
- $files = globBrace($themeFolder, $glob, '*.html');
+ $files = globBrace($themeFolder . DS, $glob, '*.html');
foreach ($files as $file) {
$file = preg_replace('@^.*/themes/[^/]+/@', '', $file);
@@ -1469,14 +1469,14 @@ function getUrl($url, $cache = true, $expire = 604800, $timeout = 1, $exception
return $result;
} else {
$result = false;
-
+
//try with curl
- if (function_exists('curl_init')) {
+ if (function_exists('curl_init')) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
- curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
+ curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
$result = curl_exec($ch);
curl_close($ch);
@@ -1500,8 +1500,9 @@ function getUrl($url, $cache = true, $expire = 604800, $timeout = 1, $exception
'ignore_errors' => 1,
],
];
-
+
$context = stream_context_create($context_options);
+
if ($exception) {
$result = file_get_contents($url, false, $context);
} else {
@@ -1515,7 +1516,7 @@ function getUrl($url, $cache = true, $expire = 604800, $timeout = 1, $exception
}
return $result;
- }
+ }
}
}
diff --git a/system/functions/php-mo.php b/system/functions/php-mo.php
index 8128edc..df6e256 100755
--- a/system/functions/php-mo.php
+++ b/system/functions/php-mo.php
@@ -93,7 +93,7 @@ function phpmo_parse_po_file($in) {
$data = $pair[1] ?? null;
if ($data === null) {
- $continue;
+ continue;
}
switch ($key) {