X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FBlogspamNet%2FBlogspamNetPlugin.php;h=2cab69be30e03672b33dd1aab8926baf0d69fdb7;hb=546a03b5eac5f172d543a889625e2f4de446e8b7;hp=51a86b4f36a6e3a92c497560ce6a74e353dcdb07;hpb=3005f26aa23cf8fb8dca0a5ffed284e054fb77b9;p=quix0rs-gnu-social.git diff --git a/plugins/BlogspamNet/BlogspamNetPlugin.php b/plugins/BlogspamNet/BlogspamNetPlugin.php index 51a86b4f36..2cab69be30 100644 --- a/plugins/BlogspamNet/BlogspamNetPlugin.php +++ b/plugins/BlogspamNet/BlogspamNetPlugin.php @@ -82,13 +82,19 @@ class BlogspamNetPlugin extends Plugin } else { common_debug("Blogspamnet results = " . $response); if (preg_match('/^ERROR(:(.*))?$/', $response, $match)) { - throw new ServerException(sprintf(_("Error from %s: %s"), $this->baseUrl, $match[2]), 500); + // TRANS: Server exception thrown when blogspam.net returns error status. + // TRANS: %1$s is the base URL, %2$s is the error (unknown contents; no period). + throw new ServerException(sprintf(_m('Error from %1$s: %2$s'), $this->baseUrl, $match[2]), 500); } else if (preg_match('/^SPAM(:(.*))?$/', $response, $match)) { - throw new ClientException(sprintf(_("Spam checker results: %s"), $match[2]), 400); + // TRANS: Server exception thrown when blogspam.net returns spam status. + // TRANS: Does not end with period because of unknown contents for %s (spam match). + throw new ClientException(sprintf(_m('Spam checker results: %s'), $match[2]), 400); } else if (preg_match('/^OK$/', $response)) { // don't do anything } else { - throw new ServerException(sprintf(_("Unexpected response from %s: %s"), $this->baseUrl, $response), 500); + // TRANS: Server exception thrown when blogspam.net returns an unexpected status. + // TRANS: %1$s is the base URL, %2$s is the response (unknown contents; no period). + throw new ServerException(sprintf(_m('Unexpected response from %1$s: %2$s'), $this->baseUrl, $response), 500); } } return true; @@ -137,18 +143,19 @@ class BlogspamNetPlugin extends Plugin return '127.0.0.1'; } - function userAgent() + function version() { - return 'BlogspamNetPlugin/'.BLOGSPAMNETPLUGIN_VERSION . ' StatusNet/' . STATUSNET_VERSION; + return BLOGSPAMNETPLUGIN_VERSION; } - function onPluginVersion(&$versions) + function onPluginVersion(array &$versions) { $versions[] = array('name' => 'BlogspamNet', 'version' => BLOGSPAMNETPLUGIN_VERSION, 'author' => 'Evan Prodromou, Brion Vibber', 'homepage' => 'http://status.net/wiki/Plugin:BlogspamNet', 'rawdescription' => + // TRANS: Plugin description. _m('Plugin to check submitted notices with blogspam.net.')); return true; }