mikuli.cz

:)
git clone https://git.sr.ht/~ashymad/mikuli.cz
Log | Files | Refs

commit 913a5b637c6219720a76663fccaf4f3a631c4441
parent ec95389bdac86bec5065fd93ea274600e9c55e9a
Author: markseu <mark2011@mayberg.se>
Date:   Mon, 22 Dec 2014 00:53:51 +0100

Core update (better PHP 5.3 support)

Diffstat:
MREADME.md | 4++--
Msystem/core/core-webinterface.js | 8++++----
Msystem/core/core-webinterface.php | 12++++++------
Msystem/core/core.php | 10++++++++--
4 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/README.md b/README.md @@ -1,4 +1,4 @@ -Yellow 0.4.14 +Yellow 0.4.15 ============= [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/markseu/yellowcms) @@ -11,7 +11,7 @@ How do I install this? 3. Open your website in a browser. Installation requirements are Apache, mod_rewrite, PHP 5.3+. -Yellow doesn't come with a lot of stuff. [Download Yellow extensions](https://github.com/markseu/yellowcms-extensions). +Yellow doesn't come with a lot of stuff. There are [Yellow extensions](https://github.com/markseu/yellowcms-extensions). How do I get started? --------------------- diff --git a/system/core/core-webinterface.js b/system/core/core-webinterface.js @@ -4,7 +4,7 @@ // Yellow main API var yellow = { - version: "0.4.2", + version: "0.4.3", action: function(text) { yellow.webinterface.action(text); }, onClick: function(e) { yellow.webinterface.hidePanesOnClick(yellow.toolbox.getEventElement(e)); }, onKeydown: function(e) { yellow.webinterface.hidePanesOnKeydown(yellow.toolbox.getEventKeycode(e)); }, @@ -516,9 +516,9 @@ yellow.toolbox = encodeNewline: function(string) { return string - .replace(/[\\]/g, "\\\\") - .replace(/[\r]/g, "\\r") - .replace(/[\n]/g, "\\n"); + .replace(/[%]/g, "%25") + .replace(/[\r]/g, "%0d") + .replace(/[\n]/g, "%0a"); }, // Submit form with post method diff --git a/system/core/core-webinterface.php b/system/core/core-webinterface.php @@ -5,7 +5,7 @@ // Web interface core plugin class YellowWebinterface { - const Version = "0.4.5"; + const Version = "0.4.6"; var $yellow; //access to API var $active; //web interface is active? (boolean) var $userLoginFailed; //web interface login failed? (boolean) @@ -216,8 +216,8 @@ class YellowWebinterface $statusCode = 0; if($this->userPermission && !empty($_POST["rawdataedit"])) { - $this->rawDataSource = $this->rawDataEdit = stripcslashes($_POST["rawdatasource"]); - $page = $this->getPageNew($serverScheme, $serverName, $base, $location, $fileName, stripcslashes($_POST["rawdataedit"])); + $this->rawDataSource = $this->rawDataEdit = rawurldecode($_POST["rawdatasource"]); + $page = $this->getPageNew($serverScheme, $serverName, $base, $location, $fileName, rawurldecode($_POST["rawdataedit"])); if(!$page->isError()) { if($this->yellow->toolbox->createFile($page->fileName, $page->rawData)) @@ -245,8 +245,8 @@ class YellowWebinterface $statusCode = 0; if($this->userPermission && !empty($_POST["rawdataedit"])) { - $this->rawDataSource = stripcslashes($_POST["rawdatasource"]); - $this->rawDataEdit = stripcslashes($_POST["rawdataedit"]); + $this->rawDataSource = rawurldecode($_POST["rawdatasource"]); + $this->rawDataEdit = rawurldecode($_POST["rawdataedit"]); $page = $this->getPageUpdate($serverScheme, $serverName, $base, $location, $fileName, $this->rawDataSource, $this->rawDataEdit, $this->yellow->toolbox->getFileData($fileName)); if(!$page->isError()) @@ -277,7 +277,7 @@ class YellowWebinterface $statusCode = 0; if($this->userPermission) { - $this->rawDataSource = $this->rawDataEdit = stripcslashes($_POST["rawdatasource"]); + $this->rawDataSource = $this->rawDataEdit = rawurldecode($_POST["rawdatasource"]); if(!is_file($fileName) || $this->yellow->toolbox->deleteFile($fileName)) { $statusCode = 303; diff --git a/system/core/core.php b/system/core/core.php @@ -5,7 +5,7 @@ // Yellow main class class Yellow { - const Version = "0.4.14"; + const Version = "0.4.15"; var $page; //current page var $pages; //pages from file system var $config; //configuration @@ -1121,7 +1121,13 @@ class YellowConfig // Return configuration function get($key) { - return $this->isExisting($key) ? $this->config[$key] : $this->configDefaults[$key]; + if(!is_null($this->config[$key])) + { + $value = $this->config[$key]; + } else { + $value = !is_null($this->configDefaults[$key]) ? $this->configDefaults[$key] : ""; + } + return $value; } // Return configuration, HTML encoded