aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-10-28 12:21:53 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-10-28 12:21:53 +0000
commit56b051a4f64e2150569cabcc32c331edf1838aa3 (patch)
tree56ddb04cf011896b7b44366e607d8d187a382061
parent853b9448de06328fe2bc2c7be7dcee3d9cc25902 (diff)
downloadelgg-56b051a4f64e2150569cabcc32c331edf1838aa3.tar.gz
elgg-56b051a4f64e2150569cabcc32c331edf1838aa3.tar.bz2
Closes #440
git-svn-id: https://code.elgg.org/elgg/trunk@2326 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/social.php96
-rw-r--r--languages/en.php5
2 files changed, 61 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");
diff --git a/languages/en.php b/languages/en.php
index 40dd0ffc7..6b1f486cd 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -815,6 +815,11 @@ You cannot reply to this email.",
'actiongatekeeper:pluginprevents' => 'A extension has prevented this form from being submitted.',
/**
+ * Word blacklists
+ */
+ 'word:blacklist' => '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',
+
+ /**
* Languages according to ISO 639-1
*/
"aa" => "Afar",