X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fsalmon.php;h=6eea57f6a7e3a3d70066e83ea49aabf240e311f9;hb=6a23f51549e6b476d494dce4131a24f8ebcdba43;hp=ba1bc8d46513e54caf0c58be55487e5a0387b79c;hpb=2628da422a57f573466f08ca3eb5791bf2bc35cf;p=friendica.git diff --git a/mod/salmon.php b/mod/salmon.php index ba1bc8d465..6eea57f6a7 100644 --- a/mod/salmon.php +++ b/mod/salmon.php @@ -1,23 +1,41 @@ . + * */ + use Friendica\App; use Friendica\Core\Logger; -use Friendica\Core\PConfig; use Friendica\Core\Protocol; -use Friendica\Core\System; use Friendica\Database\DBA; +use Friendica\DI; use Friendica\Model\Contact; +use Friendica\Protocol\ActivityNamespace; use Friendica\Protocol\OStatus; use Friendica\Protocol\Salmon; use Friendica\Util\Crypto; +use Friendica\Util\Network; use Friendica\Util\Strings; function salmon_post(App $a, $xml = '') { if (empty($xml)) { - $xml = file_get_contents('php://input'); + $xml = Network::postdata(); } Logger::log('new salmon ' . $xml, Logger::DATA); @@ -35,7 +53,7 @@ function salmon_post(App $a, $xml = '') { // parse the xml - $dom = simplexml_load_string($xml,'SimpleXMLElement',0,NAMESPACE_SALMON_ME); + $dom = simplexml_load_string($xml,'SimpleXMLElement',0, ActivityNamespace::SALMON_ME); $base = null; @@ -156,7 +174,7 @@ function salmon_post(App $a, $xml = '') { if (!DBA::isResult($r)) { Logger::log('Author ' . $author_link . ' unknown to user ' . $importer['uid'] . '.'); - if (PConfig::get($importer['uid'], 'system', 'ostatus_autofriend')) { + if (DI::pConfig()->get($importer['uid'], 'system', 'ostatus_autofriend')) { $result = Contact::createFromProbe($importer['uid'], $author_link); if ($result['success']) {