diff options
author | Laria Carolin Chabowski <laria@laria.me> | 2020-09-25 21:24:01 +0200 |
---|---|---|
committer | Laria Carolin Chabowski <laria@laria.me> | 2020-09-25 21:27:43 +0200 |
commit | 78c0350b3b7fc025ba565e19bfa195b68e95bb88 (patch) | |
tree | 94ac3aba1cba328a7e50bac408e72c269d18d9b4 /ratatoeskr/backend.php | |
parent | 60542d424f71347e75e3e43daf964f679cf26aee (diff) | |
download | ratatoeskr-cms-78c0350b3b7fc025ba565e19bfa195b68e95bb88.tar.gz ratatoeskr-cms-78c0350b3b7fc025ba565e19bfa195b68e95bb88.tar.bz2 ratatoeskr-cms-78c0350b3b7fc025ba565e19bfa195b68e95bb88.zip |
Deprecate htmlesc for Esc::esc
"Stole" this class from another project of mine (micropoly)
Diffstat (limited to 'ratatoeskr/backend.php')
-rw-r--r-- | ratatoeskr/backend.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/ratatoeskr/backend.php b/ratatoeskr/backend.php index c050922..df1ea5b 100644 --- a/ratatoeskr/backend.php +++ b/ratatoeskr/backend.php @@ -9,6 +9,8 @@ * See "ratatoeskr/licenses/ratatoeskr" for more information. */ +use r7r\cms\sys\Esc; + require_once(dirname(__FILE__) . "/sys/models.php"); require_once(dirname(__FILE__) . "/sys/pwhash.php"); require_once(dirname(__FILE__) . "/sys/textprocessors.php"); @@ -269,7 +271,7 @@ function build_backend_subactions() call_user_func($cb, $article); } $ste->vars["article_editurl"] = urlencode($article->urlname) . "/" . urlencode($editlang); - $ste->vars["success"] = htmlesc($translation["article_save_success"]); + $ste->vars["success"] = Esc::esc($translation["article_save_success"]); } catch (AlreadyExistsError $e) { $fail_reasons[] = $translation["article_name_already_in_use"]; } @@ -305,7 +307,7 @@ function build_backend_subactions() call_user_func($cb, $article); } $ste->vars["article_editurl"] = urlencode($article->urlname) . "/" . urlencode($editlang); - $ste->vars["success"] = htmlesc($translation["article_save_success"]); + $ste->vars["success"] = Esc::esc($translation["article_save_success"]); } catch (AlreadyExistsError $e) { $fail_reasons[] = $translation["article_name_already_in_use"]; } @@ -700,9 +702,9 @@ function build_backend_subactions() if ($imageaction == "markdown") { $ste->vars["embed_code"] = "![" . str_replace("]", "\\]", $_POST["img_alt"]) . "](%root%/images/" . str_replace(")", "\\)", urlencode($image->get_filename())) . ")"; } elseif ($imageaction == "html") { - $ste->vars["embed_code"] = "<img src=\"%root%/images/" . htmlesc(urlencode($image->get_filename())) . "\" alt=\"" . htmlesc($_POST["img_alt"]) . "\" />"; + $ste->vars["embed_code"] = "<img src=\"%root%/images/" . Esc::esc(urlencode($image->get_filename())) . "\" alt=\"" . Esc::esc($_POST["img_alt"]) . "\" />"; } elseif ($imageaction == "ste") { - $ste->vars["embed_code"] = "<img src=\"\$rel_path_to_root/images/" . htmlesc(urlencode($image->get_filename())) . "\" alt=\"" . htmlesc($_POST["img_alt"]) . "\" />"; + $ste->vars["embed_code"] = "<img src=\"\$rel_path_to_root/images/" . Esc::esc(urlencode($image->get_filename())) . "\" alt=\"" . Esc::esc($_POST["img_alt"]) . "\" />"; } } @@ -1617,7 +1619,7 @@ function build_backend_subactions() $ste->vars["success"] = $translation[$newstatus ? "plugins_activated" : "plugins_deactivated"]; if (!empty($api_incompat)) { - $ste->vars["error"] = htmlesc(str_replace("[[PLUGINS]]", implode(", ", $api_incompat), $translation["could_not_activate_plugin_api_incompat"])); + $ste->vars["error"] = Esc::esc(str_replace("[[PLUGINS]]", implode(", ", $api_incompat), $translation["could_not_activate_plugin_api_incompat"])); } } @@ -1679,7 +1681,7 @@ function build_backend_subactions() } if (!empty($api_incompat)) { - $ste->vars["notice"] = htmlesc(str_replace("[[PLUGINS]]", implode(", ", $api_incompat), $translation["plugins_incompat"])); + $ste->vars["notice"] = Esc::esc(str_replace("[[PLUGINS]]", implode(", ", $api_incompat), $translation["plugins_incompat"])); } echo $ste->exectemplate("/systemtemplates/pluginlist.html"); |