]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/postnotice.php
Merge branch '1.0.x' into testing
[quix0rs-gnu-social.git] / actions / postnotice.php
index ad3f00e349f8f86e549c286cca9cf3543ca6465d..43c764aa63b10728944eb2053c1415bf16fe0d14 100644 (file)
@@ -76,8 +76,8 @@ class PostnoticeAction extends Action
             $srv->handlePostNotice();
         } catch (OMB_RemoteServiceException $rse) {
             $msg = $rse->getMessage();
-            if (preg_match('/^Revoked accesstoken/', $msg) ||
-                preg_match('/^No subscriber/', $msg)) {
+            if (preg_match('/Revoked accesstoken/', $msg) ||
+                preg_match('/No subscriber/', $msg)) {
                 $this->clientError($msg, 403);
             } else {
                 $this->clientError($msg);
@@ -92,16 +92,18 @@ class PostnoticeAction extends Action
     {
         $content = common_shorten_links($_POST['omb_notice_content']);
         if (Notice::contentTooLong($content)) {
-            $this->clientError(_('Invalid notice content'), 400);
+            // TRANS: Client error displayed if the notice posted has too many characters.
+            $this->clientError(_('Invalid notice content.'), 400);
             return false;
         }
         $license      = $_POST['omb_notice_license'];
         $site_license = common_config('license', 'url');
         if ($license && !common_compatible_license($license, $site_license)) {
-            throw new Exception(sprintf(_('Notice license ā€˜%1$sā€™ is not ' .
-                                          'compatible with site license ā€˜%2$sā€™.'),
+            // TRANS: Exception thrown if a notice's license is not compatible with the StatusNet site license.
+            // TRANS: %1$s is the notice license, %2$s is the StatusNet site's license.
+            throw new Exception(sprintf(_('Notice license "%1$s" is not ' .
+                                          'compatible with site license "%2$s".'),
                                         $license, $site_license));
         }
     }
 }
-?>
\ No newline at end of file