Skip to content

armgit / Vvveb

Public Imported from GitHub
0

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

Fixed template list wrong html path on windows because of different directory separator

givanz81cc62125243
diff --git a/system/functions.php b/system/functions.php
index 5eafb1b..b8cd9c4 100755
--- a/system/functions.php
+++ b/system/functions.php
@@ -80,7 +80,7 @@ function url($parameters, $mergeParameters = false, $useCurrentUrl = true) {
$result .= ($useCurrentUrl ? $url['path'] ?? '' : '') . ($parameters ? '?' . urldecode(http_build_query($parameters)) : '');
}
- return $result;
+ return $result;
}
function config($key = null, $default = null) {
@@ -321,6 +321,10 @@ function filterText($data) {
function session($data, $default = null) {
$session = System\Session :: getInstance();
+ if (! $session) {
+ return $default;
+ }
+
if (is_array($data)) {
foreach ($data as $key => $value) {
$session->set($key, $value);
@@ -950,7 +954,7 @@ function getTemplateList($theme = null, $skip = []) {
$files = globBrace($themeFolder . DS, $glob, '*.html');
foreach ($files as $file) {
- $file = preg_replace('@^.*/themes/[^/]+/@', '', $file);
+ $file = preg_replace('@^.*[\\\/]themes[\\\/][^\\\/]+[\\\/]@', '', $file);
$filename = basename($file);
$folder = \Vvveb\System\Functions\Str::match('@(\w+)/.*?$@', $file) ?? '/';
@@ -980,7 +984,7 @@ function getTemplateList($theme = null, $skip = []) {
}
}
- ksort($pages);
+ //ksort($pages);
return $pages;
}
@@ -1823,7 +1827,11 @@ function array2xml($array, $xml = false) {
$xml->addAttribute($key, htmlentities($value));
} else {
$processAttr($value);
- $node = $xml->addChild($key, htmlentities($value));
+
+ if ($value && is_string($value)) {
+ $value = htmlentities($value);
+ }
+ $node = $xml->addChild($key, $value);
if ($attributes) {
foreach ($attributes as $key => $val) {