X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FLinkPreview%2Foembedproxyaction.php;h=7e54aca57067de6bce92a0e4d76f7f85c22181a5;hb=dc4a42e60004f92c2e821ba34d17245f417e2895;hp=5d76535b22991bcc881f3f0b6d7318f3852d27c2;hpb=1e73ba00bdd37f46415eb45b1b904dc894fb801c;p=quix0rs-gnu-social.git diff --git a/plugins/LinkPreview/oembedproxyaction.php b/plugins/LinkPreview/oembedproxyaction.php index 5d76535b22..7e54aca570 100644 --- a/plugins/LinkPreview/oembedproxyaction.php +++ b/plugins/LinkPreview/oembedproxyaction.php @@ -35,7 +35,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { * * This class provides an interface for our JS-side code to pull info on * links from other sites, using either native oEmbed, our own custom - * handlers, or the oohEmbed.com offsite proxy service as configured. + * handlers, or the noembed.com offsite proxy service as configured. * * @category oEmbed * @package StatusNet @@ -44,10 +44,8 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ - class OembedproxyAction extends OembedAction { - function handle($args) { // Trigger short error responses; not a human-readable web page. @@ -56,18 +54,21 @@ class OembedproxyAction extends OembedAction // We're not a general oEmbed proxy service; limit to valid sessions. $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { + // TRANS: Client error displayed when the session token does not match or is not given. $this->clientError(_m('There was a problem with your session token. '. 'Try again, please.')); } $format = $this->arg('format'); if ($format && $format != 'json') { - throw new ClientException('Invalid format; only JSON supported.'); + // TRANS: Client exception thrown when requesting a different format than JSON. + throw new ClientException(_m('Invalid format; only JSON supported.')); } $url = $this->arg('url'); if (!common_valid_http_url($url)) { - throw new ClientException('Invalid URL.'); + // TRANS: Client exception thrown when not providing a valid URL. + throw new ClientException(_m('Invalid URL.')); } $params = array(); @@ -83,5 +84,4 @@ class OembedproxyAction extends OembedAction $this->init_document('json'); print json_encode($data); } - }