]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Irc/extlib/phergie/Phergie/Plugin/Censor.php
MINOR: Please don't set a+x on files which are not being executed as shell script...
[quix0rs-gnu-social.git] / plugins / Irc / extlib / phergie / Phergie / Plugin / Censor.php
old mode 100755 (executable)
new mode 100644 (file)
index 3206bdd..99c69d8
@@ -72,7 +72,19 @@ class Phergie_Plugin_Censor extends Phergie_Plugin_Abstract
             $this->soap = new SoapClient('http://ws.cdyne.com/ProfanityWS/Profanity.asmx?wsdl');
         }
         $params = array('Text' => $string);
-        $response = $this->soap->SimpleProfanityFilter($params);
+        $attempts = 0;
+        while ($attempts < 3) {
+            try {
+                $response = $this->soap->SimpleProfanityFilter($params);
+                break;
+            } catch (SoapFault $e) {
+                $attempts++;
+                sleep(1);
+            }
+        }
+        if ($attempts == 3) {
+            return $string;
+        }
         return $response->SimpleProfanityFilterResult->CleanText;
     }