diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-10-28 12:21:53 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-10-28 12:21:53 +0000 |
commit | 56b051a4f64e2150569cabcc32c331edf1838aa3 (patch) | |
tree | 56ddb04cf011896b7b44366e607d8d187a382061 /engine/lib | |
parent | 853b9448de06328fe2bc2c7be7dcee3d9cc25902 (diff) | |
download | elgg-56b051a4f64e2150569cabcc32c331edf1838aa3.tar.gz elgg-56b051a4f64e2150569cabcc32c331edf1838aa3.tar.bz2 |
Closes #440
git-svn-id: https://code.elgg.org/elgg/trunk@2326 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/social.php | 96 |
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");
|