summaryrefslogtreecommitdiff
path: root/inc/confutils.php
diff options
context:
space:
mode:
authorChristopher Smith <chris@jalakai.co.uk>2015-05-18 20:34:47 +0100
committerChristopher Smith <chris@jalakai.co.uk>2015-05-18 20:34:47 +0100
commit10b38f10e6ce99d01c6ca30bcd9992699d6ee049 (patch)
tree0da8ce3cabf73377abd298fbb66b1a6ee6a857af /inc/confutils.php
parent3a7669bd1068f34022db08228baeefae2b27d05b (diff)
downloadrpg-10b38f10e6ce99d01c6ca30bcd9992699d6ee049.tar.gz
rpg-10b38f10e6ce99d01c6ca30bcd9992699d6ee049.tar.bz2
Define the negation character in a constant
Diffstat (limited to 'inc/confutils.php')
-rw-r--r--inc/confutils.php8
1 files changed, 7 insertions, 1 deletions
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]);