Merged in Phergie changes

This commit is contained in:
Luke Fitzgerald
2010-08-03 09:42:02 -07:00
parent 9b9a36e492
commit a3df3b6367
30 changed files with 1546 additions and 719 deletions

View File

@@ -113,20 +113,21 @@ class Phergie_Plugin_Serve extends Phergie_Plugin_Abstract
$item = $this->getItem($database, $table, $match);
// Reprocess the request for censorship if required
$attempts = 0;
while ($censor && $attempts < 3) {
if ($this->plugins->hasPlugin('Censor')) {
$plugin = $this->plugins->getPlugin('Censor');
$clean = $plugin->cleanString($item->name);
if ($item->name != $clean) {
$attempts++;
$item = $this->getItem($database, $table, $match);
} else {
$censor = false;
$attempts = 0;
while ($censor && $attempts < 3) {
$clean = $plugin->cleanString($item->name);
if ($item->name != $clean) {
$attempts++;
$item = $this->getItem($database, $table, $match);
} else {
$censor = false;
}
}
if ($censor && $attempts == 3) {
$this->doAction($this->event->getSource(), 'shrugs.');
}
}
if ($censor && $attempts == 3) {
$this->doAction($this->event->getSource(), 'shrugs.');
}
// Derive the proper article for the item