X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FIrc%2Fextlib%2Fphergie%2FPhergie%2FPlugin%2FCensor.php;h=99c69d873452248604f5caf15a7a133f8cc63950;hb=dfe0a317ca36ae6da672b4230d888370eb0989af;hp=3206bdd288d36817fc0e32bf7f52ea5c935e6119;hpb=bf6ecfbffc795c1f5b011751a7f4dc8a9d0c14f1;p=quix0rs-gnu-social.git diff --git a/plugins/Irc/extlib/phergie/Phergie/Plugin/Censor.php b/plugins/Irc/extlib/phergie/Phergie/Plugin/Censor.php old mode 100755 new mode 100644 index 3206bdd288..99c69d8734 --- a/plugins/Irc/extlib/phergie/Phergie/Plugin/Censor.php +++ b/plugins/Irc/extlib/phergie/Phergie/Plugin/Censor.php @@ -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; }