diff options
author | Laria Carolin Chabowski <laria@laria.me> | 2020-09-21 21:17:38 +0200 |
---|---|---|
committer | Laria Carolin Chabowski <laria@laria.me> | 2020-09-21 21:30:57 +0200 |
commit | 13b11317f7acd705a6ef1bb05a520879eb1b9c86 (patch) | |
tree | ea97017d45a12667d801047b6571f53747f28336 /ratatoeskr | |
parent | 131e241c3d755b0fb5c5ccb4d7a11253a54b0661 (diff) | |
download | ratatoeskr-cms-13b11317f7acd705a6ef1bb05a520879eb1b9c86.tar.gz ratatoeskr-cms-13b11317f7acd705a6ef1bb05a520879eb1b9c86.tar.bz2 ratatoeskr-cms-13b11317f7acd705a6ef1bb05a520879eb1b9c86.zip |
Turn global function defined in a function to a closure
Yikes! What was younger me thinking?
Diffstat (limited to 'ratatoeskr')
-rw-r--r-- | ratatoeskr/backend.php | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/ratatoeskr/backend.php b/ratatoeskr/backend.php index ab18ce1..658bcc1 100644 --- a/ratatoeskr/backend.php +++ b/ratatoeskr/backend.php @@ -220,8 +220,7 @@ function build_backend_subactions() } } - function fill_article(&$article, $inputs, $editlang) - { + $fill_article = function (Article &$article, array $inputs, string $editlang) { $article->urlname = $inputs["urlname"]; $article->status = $inputs["article_status"]; $article->timestamp = $inputs["date"]; @@ -231,14 +230,14 @@ function build_backend_subactions() $article->set_tags(maketags($inputs["tags"], $editlang)); $article->set_section($inputs["article_section"]); $article->allow_comments = $inputs["allow_comments"]; - } + }; if (empty($article)) { /* New Article */ $ste->vars["pagetitle"] = $translation["new_article"]; if (empty($fail_reasons) and isset($_POST["save_article"])) { $article = Article::create($inputs["urlname"]); - fill_article($article, $inputs, $editlang); + $fill_article($article, $inputs, $editlang); /* Calling articleeditor plugins */ $call_after_save = []; @@ -274,7 +273,7 @@ function build_backend_subactions() } if (empty($fail_reasons) and isset($_POST["save_article"])) { - fill_article($article, $inputs, $editlang); + $fill_article($article, $inputs, $editlang); /* Calling articleeditor plugins */ $call_after_save = []; |