aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/social.php96
1 files changed, 56 insertions, 40 deletions
diff --git a/engine/lib/social.php b/engine/lib/social.php
index ffa98444b..2f288db48 100644
--- a/engine/lib/social.php
+++ b/engine/lib/social.php
@@ -64,47 +64,63 @@
}
- // Set the shout words blacklist, these do not become tags when the string is converted
- // Any language packs should include their own!
-
+
+ /**
+ * Initialise.
+ *
+ * Sets a blacklist of words in the current language. This is a comma separated list in word:blacklist.
+ */
function social_init() {
- global $CONFIG;
- $CONFIG->wordblacklist = array(
- 'and',
- 'the',
- 'then',
- 'but',
- 'she',
- 'his',
- 'her',
- 'him',
- 'one',
- 'not',
- 'also',
- 'about',
- 'now',
- 'hence',
- 'however',
- 'still',
- 'likewise',
- 'otherwise',
- 'therefore',
- 'conversely',
- 'rather',
- 'consequently',
- 'furthermore',
- 'nevertheless',
- 'instead',
- 'meanwhile',
- 'accordingly',
- 'this',
- 'seems',
- 'what',
- 'whom',
- 'whose',
- 'whoever',
- 'whomever',
- );
+ global $CONFIG;
+
+ $CONFIG->wordblacklist = array();
+
+ $list = explode(',', elgg_echo('word:blacklist'));
+ if ($list)
+ {
+ foreach ($list as $l)
+ $CONFIG->wordblacklist[] = trim($l);
+ }
+ else
+ {
+ // Fallback - shouldn't happen
+ $CONFIG->wordblacklist = array(
+ 'and',
+ 'the',
+ 'then',
+ 'but',
+ 'she',
+ 'his',
+ 'her',
+ 'him',
+ 'one',
+ 'not',
+ 'also',
+ 'about',
+ 'now',
+ 'hence',
+ 'however',
+ 'still',
+ 'likewise',
+ 'otherwise',
+ 'therefore',
+ 'conversely',
+ 'rather',
+ 'consequently',
+ 'furthermore',
+ 'nevertheless',
+ 'instead',
+ 'meanwhile',
+ 'accordingly',
+ 'this',
+ 'seems',
+ 'what',
+ 'whom',
+ 'whose',
+ 'whoever',
+ 'whomever',
+ );
+ }
}
register_elgg_event_handler("init","system","social_init");