X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FSubMirror%2Factions%2Faddmirror.php;h=738fa92f47366e10ba5db02b8149d5d5522df77e;hb=0193c7548f075ecf2f07dd8ca55b1b8f45e708ff;hp=4e2e1a0c52a77a56de327a6f933123271175b7fa;hpb=6f427d7e43ef6cd2f52ea9b03f65c5f9e202931c;p=quix0rs-gnu-social.git diff --git a/plugins/SubMirror/actions/addmirror.php b/plugins/SubMirror/actions/addmirror.php index 4e2e1a0c52..738fa92f47 100644 --- a/plugins/SubMirror/actions/addmirror.php +++ b/plugins/SubMirror/actions/addmirror.php @@ -26,9 +26,7 @@ * @link http://status.net/ */ -if (!defined('STATUSNET')) { - exit(1); -} +if (!defined('GNUSOCIAL') && !defined('STATUSNET')) { exit(1); } /** * Takes parameters: @@ -56,7 +54,7 @@ class AddMirrorAction extends BaseMirrorAction * * @return boolean success flag */ - function prepare($args) + protected function prepare(array $args=array()) { parent::prepare($args); $feedurl = $this->getFeedUrl(); @@ -77,13 +75,9 @@ class AddMirrorAction extends BaseMirrorAction } } - function saveMirror() + protected function saveMirror() { - if ($this->oprofile->subscribe()) { - SubMirror::saveMirror($this->user, $this->profile); - } else { - // TRANS: Exception thrown when a subscribing to a feed fails. - $this->serverError(_m('Could not subscribe to feed.')); - } + $this->oprofile->subscribe(); + SubMirror::saveMirror($this->user, $this->profile); } }