mikuli.cz

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

commit 8a04dbdf4c5bc041bbcc970cfd676a35f48c1fad
parent 48fe43e55868a1018dbf1f9a8bb65aea59ca6d46
Author: markseu <mark2011@mayberg.se>
Date:   Thu, 23 Jul 2020 08:36:57 +0200

Updated extensions, summer cleanup

Diffstat:
Msystem/extensions/bundle.php | 4++--
Msystem/extensions/core.php | 30+++++++++++++++---------------
Msystem/extensions/edit.php | 10+++++-----
Msystem/extensions/install-languages.zip | 0
Msystem/extensions/install.php | 12++++++------
5 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/system/extensions/bundle.php b/system/extensions/bundle.php @@ -4,7 +4,7 @@ // This file may be used and distributed under the terms of the public license. class YellowBundle { - const VERSION = "0.8.12"; + const VERSION = "0.8.13"; const TYPE = "feature"; public $yellow; //access to API @@ -140,7 +140,7 @@ class YellowBundle { $thisCompatible = $this; $callback = function ($matches) use ($thisCompatible, $scheme, $address, $base) { $url = $thisCompatible->yellow->lookup->normaliseUrl($scheme, $address, $base, $matches[1], false); - $url = strreplaceu("$scheme://$address", "", $url); + $url = str_replace("$scheme://$address", "", $url); return "url(\"$url\")"; }; $fileData = preg_replace_callback("/url\([\'\"]?(.*?)[\'\"]?\)/", $callback, $fileData); diff --git a/system/extensions/core.php b/system/extensions/core.php @@ -174,7 +174,7 @@ class YellowCore { if ($statusCode>=400) { $locationError = $this->content->getHomeLocation($this->page->location).$this->system->get("coreContentSharedDirectory"); $fileNameError = $this->lookup->findFileFromLocation($locationError, true).$this->system->get("coreContentErrorFile"); - $fileNameError = strreplaceu("(.*)", $statusCode, $fileNameError); + $fileNameError = str_replace("(.*)", $statusCode, $fileNameError); if (is_file($fileNameError)) { $rawData = $this->toolbox->readFile($fileNameError); } else { @@ -559,7 +559,7 @@ class YellowPage { } fclose($fileHandle); } - $output = strreplaceu("\n", "<br />\n", htmlspecialchars($dataBuffer)); + $output = str_replace("\n", "<br />\n", htmlspecialchars($dataBuffer)); } } } @@ -969,14 +969,14 @@ class YellowPageCollection extends ArrayObject { // Filter page collection by setting public function filter($key, $value, $exactMatch = true) { $array = array(); - $value = strreplaceu(" ", "-", strtoloweru($value)); + $value = str_replace(" ", "-", strtoloweru($value)); $valueLength = strlenu($value); $this->filterValue = ""; foreach ($this->getArrayCopy() as $page) { if ($page->isExisting($key)) { foreach (preg_split("/\s*,\s*/", $page->get($key)) as $pageValue) { $pageValueLength = $exactMatch ? strlenu($pageValue) : $valueLength; - if ($value==substru(strreplaceu(" ", "-", strtoloweru($pageValue)), 0, $pageValueLength)) { + if ($value==substru(str_replace(" ", "-", strtoloweru($pageValue)), 0, $pageValueLength)) { if (empty($this->filterValue)) $this->filterValue = substru($pageValue, 0, $pageValueLength); array_push($array, $page); break; @@ -1953,7 +1953,7 @@ class YellowLookup { public function findFileDirectory($path, $token, $fileExtension, $directory, $default, &$found, &$invalid) { if ($this->normaliseToken($token, $fileExtension)!=$token) $invalid = true; if (!$invalid) { - $regex = "/^[\d\-\_\.]*".strreplaceu("-", ".", $token)."$/"; + $regex = "/^[\d\-\_\.]*".str_replace("-", ".", $token)."$/"; foreach ($this->yellow->toolbox->getDirectoryEntries($path, $regex, false, $directory, false) as $entry) { if ($this->normaliseToken($entry, $fileExtension)==$token) { $token = $entry; @@ -2115,8 +2115,8 @@ class YellowLookup { $location = $pageBase.$location; } } - $location = strreplaceu("/./", "/", $location); - $location = strreplaceu(":", $this->yellow->toolbox->getLocationArgumentsSeparator(), $location); + $location = str_replace("/./", "/", $location); + $location = str_replace(":", $this->yellow->toolbox->getLocationArgumentsSeparator(), $location); } else { if ($filterStrict && !preg_match("/^(http|https|ftp|mailto):/", $location)) $location = "error-xss-filter"; } @@ -2303,8 +2303,8 @@ class YellowToolbox { foreach (array_merge($_GET, $_POST) as $key=>$value) { if (!empty($key) && !strempty($value)) { if (!empty($locationArguments)) $locationArguments .= "/"; - $key = strreplaceu(array("/", ":", "="), array("\x1c", "\x1d", "\x1e"), $key); - $value = strreplaceu(array("/", ":", "="), array("\x1c", "\x1d", "\x1e"), $value); + $key = str_replace(array("/", ":", "="), array("\x1c", "\x1d", "\x1e"), $key); + $value = str_replace(array("/", ":", "="), array("\x1c", "\x1d", "\x1e"), $value); $locationArguments .= "$key:$value"; } } @@ -2347,9 +2347,9 @@ class YellowToolbox { // Normalise location arguments public function normaliseArguments($text, $appendSlash = true, $filterStrict = true) { if ($appendSlash) $text .= "/"; - if ($filterStrict) $text = strreplaceu(" ", "-", strtoloweru($text)); - $text = strreplaceu(":", $this->getLocationArgumentsSeparator(), $text); - return strreplaceu(array("%2F","%3A","%3D"), array("/",":","="), rawurlencode($text)); + if ($filterStrict) $text = str_replace(" ", "-", strtoloweru($text)); + $text = str_replace(":", $this->getLocationArgumentsSeparator(), $text); + return str_replace(array("%2F","%3A","%3D"), array("/",":","="), rawurlencode($text)); } // Normalise elements and attributes in html/svg data @@ -2838,7 +2838,7 @@ class YellowToolbox { // Create title from text string public function createTextTitle($text) { - if (preg_match("/^.*\/([\pL\d\-\_]+)/u", $text, $matches)) $text = strreplaceu("-", " ", ucfirst($matches[1])); + if (preg_match("/^.*\/([\pL\d\-\_]+)/u", $text, $matches)) $text = str_replace("-", " ", ucfirst($matches[1])); return $text; } @@ -2984,8 +2984,8 @@ class YellowToolbox { foreach (explode("/", $matches[2]) as $token) { if (preg_match("/^(.*?)$separator(.*)$/", $token, $matches)) { if (!empty($matches[1]) && !strempty($matches[2])) { - $matches[1] = strreplaceu(array("\x1c", "\x1d", "\x1e"), array("/", ":", "="), $matches[1]); - $matches[2] = strreplaceu(array("\x1c", "\x1d", "\x1e"), array("/", ":", "="), $matches[2]); + $matches[1] = str_replace(array("\x1c", "\x1d", "\x1e"), array("/", ":", "="), $matches[1]); + $matches[2] = str_replace(array("\x1c", "\x1d", "\x1e"), array("/", ":", "="), $matches[2]); $_REQUEST[$matches[1]] = $matches[2]; } } diff --git a/system/extensions/edit.php b/system/extensions/edit.php @@ -4,7 +4,7 @@ // This file may be used and distributed under the terms of the public license. class YellowEdit { - const VERSION = "0.8.28"; + const VERSION = "0.8.29"; const TYPE = "feature"; public $yellow; //access to API public $response; //web response @@ -1311,7 +1311,7 @@ class YellowEditResponse { $name = $this->yellow->lookup->normaliseName($ancestor->get("layoutNew")); $location = $this->yellow->content->getHomeLocation($page->location).$this->yellow->system->get("coreContentSharedDirectory"); $fileName = $this->yellow->lookup->findFileFromLocation($location, true).$this->yellow->system->get("editNewFile"); - $fileName = strreplaceu("(.*)", $name, $fileName); + $fileName = str_replace("(.*)", $name, $fileName); if (is_file($fileName)) break; } } @@ -1319,7 +1319,7 @@ class YellowEditResponse { $name = $this->yellow->lookup->normaliseName($this->yellow->system->get("layout")); $location = $this->yellow->content->getHomeLocation($page->location).$this->yellow->system->get("coreContentSharedDirectory"); $fileName = $this->yellow->lookup->findFileFromLocation($location, true).$this->yellow->system->get("editNewFile"); - $fileName = strreplaceu("(.*)", $name, $fileName); + $fileName = str_replace("(.*)", $name, $fileName); } if (is_file($fileName)) { $rawData = $this->yellow->toolbox->readFile($fileName); @@ -1510,14 +1510,14 @@ class YellowEditResponse { } $prefix = "edit".ucfirst($action); $message = $this->yellow->text->getText("{$prefix}Message", $userLanguage); - $message = strreplaceu("\\n", "\r\n", $message); + $message = str_replace("\\n", "\r\n", $message); $message = preg_replace("/@useraccount/i", $email, $message); $message = preg_replace("/@usershort/i", strtok($userName, " "), $message); $message = preg_replace("/@username/i", $userName, $message); $message = preg_replace("/@userlanguage/i", $userLanguage, $message); $sitename = $this->yellow->system->get("sitename"); $footer = $this->yellow->text->getText("editMailFooter", $userLanguage); - $footer = strreplaceu("\\n", "\r\n", $footer); + $footer = str_replace("\\n", "\r\n", $footer); $footer = preg_replace("/@sitename/i", $sitename, $footer); $mailTo = mb_encode_mimeheader("$userName")." <$userEmail>"; $mailSubject = mb_encode_mimeheader($this->yellow->text->getText("{$prefix}Subject", $userLanguage)); diff --git a/system/extensions/install-languages.zip b/system/extensions/install-languages.zip Binary files differ. diff --git a/system/extensions/install.php b/system/extensions/install.php @@ -4,7 +4,7 @@ // This file may be used and distributed under the terms of the public license. class YellowInstall { - const VERSION = "0.8.26"; + const VERSION = "0.8.27"; const TYPE = "feature"; const PRIORITY = "1"; public $yellow; //access to API @@ -197,14 +197,14 @@ class YellowInstall { public function updateContent($language, $name, $location) { $statusCode = 200; $fileName = $this->yellow->lookup->findFileFromLocation($location); - $fileData = strreplaceu("\r\n", "\n", $this->yellow->toolbox->readFile($fileName)); + $fileData = str_replace("\r\n", "\n", $this->yellow->toolbox->readFile($fileName)); if (!empty($fileData) && $language!="en") { $titleOld = "Title: ".$this->yellow->text->getText("{$name}Title", "en"); $titleNew = "Title: ".$this->yellow->text->getText("{$name}Title", $language); - $textOld = strreplaceu("\\n", "\n", $this->yellow->text->getText("{$name}Text", "en")); - $textNew = strreplaceu("\\n", "\n", $this->yellow->text->getText("{$name}Text", $language)); - $fileData = strreplaceu($titleOld, $titleNew, $fileData); - $fileData = strreplaceu($textOld, $textNew, $fileData); + $textOld = str_replace("\\n", "\n", $this->yellow->text->getText("{$name}Text", "en")); + $textNew = str_replace("\\n", "\n", $this->yellow->text->getText("{$name}Text", $language)); + $fileData = str_replace($titleOld, $titleNew, $fileData); + $fileData = str_replace($textOld, $textNew, $fileData); if (!$this->yellow->toolbox->createFile($fileName, $fileData)) { $statusCode = 500; $this->yellow->page->error($statusCode, "Can't write file '$fileName'!");