<?php
+/**
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
namespace Friendica\Module;
{
public static function init(array $parameters = [])
{
- if (empty($parameters['profile'])) {
- return;
- }
-
Profile::load(DI::app(), $parameters['profile']);
}
{
$a = DI::app();
- if (empty($parameters['profile']) || !empty($_POST['cancel']) || empty($_POST['dfrn_url'])) {
+ if (!empty($_POST['cancel']) || empty($_POST['dfrn_url'])) {
DI::baseUrl()->redirect();
}
if (empty($a->profile['uid'])) {
- notice(DI::l10n()->t('Profile unavailable.') . EOL);
+ notice(DI::l10n()->t('Profile unavailable.'));
return;
}
- $url = trim($_POST['dfrn_url']);
+ $url = Probe::cleanURI($_POST['dfrn_url']);
if (!strlen($url)) {
- notice(DI::l10n()->t("Invalid locator") . EOL);
+ notice(DI::l10n()->t("Invalid locator"));
return;
}
{
$a = DI::app();
- if (empty($parameters['profile']) || empty($a->profile)) {
+ if (empty($a->profile)) {
return '';
}
'$request' => 'remote_follow/' . $parameters['profile'],
'$name' => $a->profile['name'],
- '$myaddr' => '', //Profile::getMyURL(),
+ '$myaddr' => Profile::getMyURL(),
]);
return $o;
}
-}
\ No newline at end of file
+}