]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Irc/extlib/phergie/Phergie/Plugin/Serve.php
Merged in Phergie changes
[quix0rs-gnu-social.git] / plugins / Irc / extlib / phergie / Phergie / Plugin / Serve.php
index 19ecb0c7e4a01856f3c7c6706dcc339e5cb7ec99..cdb8f7f9198115b070c9243e330ff9e9c544f816 100755 (executable)
@@ -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