aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaria Carolin Chabowski <laria@laria.me>2021-01-01 20:12:21 +0100
committerLaria Carolin Chabowski <laria@laria.me>2021-01-01 20:12:25 +0100
commitc9a7d3efc61b585d6765bb8e247d6fa1ace9f4fd (patch)
treedb43bdc64131bccb68d3004f1eec11ec28d0d4e2
parent3a415231d36a48c48f51e1161b11160654961f73 (diff)
downloadratatoeskr-cms-master.tar.gz
ratatoeskr-cms-master.tar.bz2
ratatoeskr-cms-master.zip
Add htmlesc againHEADmaster
Some plugins use that function :(.
-rw-r--r--ratatoeskr/backend.php1
-rw-r--r--ratatoeskr/frontend.php1
-rw-r--r--ratatoeskr/main.php1
-rw-r--r--ratatoeskr/sys/models.php1
-rw-r--r--ratatoeskr/sys/plugin_api.php1
-rw-r--r--ratatoeskr/sys/textprocessors.php2
-rw-r--r--ratatoeskr/sys/translation.php1
-rw-r--r--ratatoeskr/sys/utils.php25
-rw-r--r--setup.php1
9 files changed, 34 insertions, 0 deletions
diff --git a/ratatoeskr/backend.php b/ratatoeskr/backend.php
index b965689..863262b 100644
--- a/ratatoeskr/backend.php
+++ b/ratatoeskr/backend.php
@@ -18,6 +18,7 @@ use r7r\cms\sys\Esc;
use r7r\cms\sys\PasswordHash;
require_once(dirname(__FILE__) . "/config.php");
+require_once(dirname(__FILE__) . "/sys/utils.php");
require_once(dirname(__FILE__) . "/sys/models.php");
require_once(dirname(__FILE__) . "/sys/textprocessors.php");
require_once(dirname(__FILE__) . "/sys/plugin_api.php");
diff --git a/ratatoeskr/frontend.php b/ratatoeskr/frontend.php
index dc76177..7f0f439 100644
--- a/ratatoeskr/frontend.php
+++ b/ratatoeskr/frontend.php
@@ -13,6 +13,7 @@ use r7r\ste;
use r7r\cms\sys\Env;
use r7r\cms\sys\Esc;
+require_once(dirname(__FILE__) . "/sys/utils.php");
require_once(dirname(__FILE__) . "/languages.php");
require_once(dirname(__FILE__) . "/config.php");
require_once(dirname(__FILE__) . "/sys/models.php");
diff --git a/ratatoeskr/main.php b/ratatoeskr/main.php
index bb8bdf9..b2e334f 100644
--- a/ratatoeskr/main.php
+++ b/ratatoeskr/main.php
@@ -17,6 +17,7 @@ if (!defined("CONFIG_FILLED_OUT") || !CONFIG_FILLED_OUT) {
}
require_once(dirname(__FILE__) . "/vendor/autoload.php");
+require_once(dirname(__FILE__) . "/sys/utils.php");
require_once(dirname(__FILE__) . "/config.php");
require_once(dirname(__FILE__) . "/sys/models.php");
require_once(dirname(__FILE__) . "/sys/init_ste.php");
diff --git a/ratatoeskr/sys/models.php b/ratatoeskr/sys/models.php
index 0716690..5fbc928 100644
--- a/ratatoeskr/sys/models.php
+++ b/ratatoeskr/sys/models.php
@@ -15,6 +15,7 @@ use r7r\cms\sys\models\KVStorage;
use r7r\cms\sys\Database;
use r7r\cms\sys\DbTransaction;
+require_once(dirname(__FILE__) . "/utils.php");
require_once(dirname(__FILE__) . "/textprocessors.php");
require_once(dirname(__FILE__) . "/pluginpackage.php");
diff --git a/ratatoeskr/sys/plugin_api.php b/ratatoeskr/sys/plugin_api.php
index 1920032..468b817 100644
--- a/ratatoeskr/sys/plugin_api.php
+++ b/ratatoeskr/sys/plugin_api.php
@@ -14,6 +14,7 @@ use r7r\cms\sys\Env;
use r7r\cms\sys\textprocessors\LegacyTextprocessor;
require_once(dirname(__FILE__) . "/../config.php");
+require_once(dirname(__FILE__) . "/utils.php");
require_once(dirname(__FILE__) . "/models.php");
require_once(dirname(__FILE__) . "/textprocessors.php");
require_once(dirname(__FILE__) . "/../frontend.php");
diff --git a/ratatoeskr/sys/textprocessors.php b/ratatoeskr/sys/textprocessors.php
index 288157d..da52043 100644
--- a/ratatoeskr/sys/textprocessors.php
+++ b/ratatoeskr/sys/textprocessors.php
@@ -13,6 +13,8 @@ use r7r\cms\sys\Env;
use r7r\cms\sys\textprocessors\LegacyTextprocessor;
use r7r\cms\sys\textprocessors\TextprocessorRepository;
+require_once(dirname(__FILE__) . "/utils.php");
+
/**
* Register a textprocessor.
*
diff --git a/ratatoeskr/sys/translation.php b/ratatoeskr/sys/translation.php
index e5387a1..d9d6cfd 100644
--- a/ratatoeskr/sys/translation.php
+++ b/ratatoeskr/sys/translation.php
@@ -12,6 +12,7 @@
use r7r\ste;
use r7r\cms\sys\Esc;
+require_once(dirname(__FILE__) . "/utils.php");
require_once(dirname(__FILE__) . "/init_ste.php");
/** @var ste\STECore $ste */
diff --git a/ratatoeskr/sys/utils.php b/ratatoeskr/sys/utils.php
new file mode 100644
index 0000000..8301e9f
--- /dev/null
+++ b/ratatoeskr/sys/utils.php
@@ -0,0 +1,25 @@
+<?php
+/*
+ * File: ratatoeskr/sys/utils.php
+ *
+ * Various useful helper functions.
+ *
+ * License:
+ * This file is part of Ratatöskr.
+ * Ratatöskr is licensed unter the MIT / X11 License.
+ * See "ratatoeskr/licenses/ratatoeskr" for more information.
+ */
+
+use r7r\cms\sys\Esc;
+
+/**
+ * Escape HTML (shorter than htmlspecialchars)
+ *
+ * @param mixed $text Input text
+ * @return string HTML
+ * @deprecated Use {@see Esc::esc()} instead.
+ */
+function htmlesc($text): string
+{
+ return Esc::esc($text);
+}
diff --git a/setup.php b/setup.php
index 8220747..bb55d8e 100644
--- a/setup.php
+++ b/setup.php
@@ -66,6 +66,7 @@ $files = [
"/ratatoeskr/sys/translation.php",
"/ratatoeskr/sys/urlprocess.php",
"/ratatoeskr/sys/pluginpackage.php",
+ "/ratatoeskr/sys/utils.php",
"/ratatoeskr/sys/init_ste.php",
"/ratatoeskr/sys/models.php",
"/ratatoeskr/sys/textprocessors.php",