diff options
-rw-r--r-- | ratatoeskr/backend.php | 1 | ||||
-rw-r--r-- | ratatoeskr/frontend.php | 1 | ||||
-rw-r--r-- | ratatoeskr/main.php | 1 | ||||
-rw-r--r-- | ratatoeskr/sys/models.php | 1 | ||||
-rw-r--r-- | ratatoeskr/sys/plugin_api.php | 1 | ||||
-rw-r--r-- | ratatoeskr/sys/textprocessors.php | 2 | ||||
-rw-r--r-- | ratatoeskr/sys/translation.php | 1 | ||||
-rw-r--r-- | ratatoeskr/sys/utils.php | 25 | ||||
-rw-r--r-- | setup.php | 1 |
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); +} @@ -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", |