Add test for public host in profile poll queue add

This commit is contained in:
Hypolite Petovan 2018-11-12 21:49:49 -05:00
parent 5207196e1a
commit 93e0153112
1 changed files with 11 additions and 0 deletions

View File

@ -2,6 +2,8 @@
namespace Friendica\Directory\Models;
use Friendica\Directory\Utils\Network;
/**
* @author Hypolite Petovan <mrpetovan@gmail.com>
*/
@ -15,6 +17,15 @@ class ProfilePollQueue extends \Friendica\Directory\Model
return false;
}
$host = parse_url($url, PHP_URL_HOST);
if (!$host) {
return false;
}
if (Network::isPublicHost($host)) {
return false;
}
$this->atlas->perform(
'INSERT IGNORE INTO `profile_poll_queue` SET `profile_url` = :profile_url',
['profile_url' => $url]