Core update (better PHP 5.3 support)

This commit is contained in:
markseu 2014-12-22 00:53:51 +01:00
parent ec95389bda
commit 913a5b637c
4 changed files with 20 additions and 14 deletions

View file

@ -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?
---------------------

View file

@ -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

View file

@ -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;

View file

@ -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