From 10b38f10e6ce99d01c6ca30bcd9992699d6ee049 Mon Sep 17 00:00:00 2001 From: Christopher Smith <chris@jalakai.co.uk> Date: Mon, 18 May 2015 20:34:47 +0100 Subject: [PATCH] Define the negation character in a constant --- inc/confutils.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/inc/confutils.php b/inc/confutils.php index c587bed4d..4035d6dd4 100644 --- a/inc/confutils.php +++ b/inc/confutils.php @@ -6,6 +6,12 @@ * @author Harry Fuecks <hfuecks@gmail.com> */ +/* + * line prefix used to negate single value config items + * (scheme.conf & stopwords.conf), e.g. + * !gopher + */ +const DOKU_CONF_NEGATION = '!'; /** * Returns the (known) extension and mimetype of a given filename @@ -364,7 +370,7 @@ function conf_decodeString($str) { */ function array_merge_with_removal($current, $new) { foreach ($new as $val) { - if (substr($val,0,1) == '!') { + if (substr($val,0,1) == DOKU_CONF_NEGATION) { $idx = array_search(trim(substr($val,1)),$current); if ($idx !== false) { unset($current[$idx]); -- GitLab