Remove validity check on profile key parameter #57

Merged
MrPetovan merged 2 commits from bug/45-drop-key-validation into stable 2020-09-26 23:07:49 +02:00
2 changed files with 1 additions and 8 deletions
Showing only changes of commit c8fa6ef3dc - Show all commits

View file

@ -333,9 +333,6 @@ class Profile
private static function validateParams(array $params): int
{
$errors = 0;
if (empty($params['key'])) {
$errors++;
}
if (empty($params['dfrn-request'])) {
$errors++;
}

View file

@ -129,7 +129,7 @@ class Scrape
$nodes_left = max(intval($max_nodes), $minNodes);
$items = $dom->getElementsByTagName('*');
$targets = array('fn', 'pdesc', 'photo', 'key', 'locality', 'region', 'postal-code', 'country-name');
$targets = array('fn', 'pdesc', 'photo', 'locality', 'region', 'postal-code', 'country-name');
$targets_left = count($targets);
foreach ($items as $item) {
if (self::attributeContains($item->getAttribute('class'), 'vcard')) {
@ -147,10 +147,6 @@ class Scrape
$params['photo'] = $vcard_element->getAttribute('src');
$targets_left = self::popScrapeTarget($targets, 'photo');
}
if (self::attributeContains($vcard_element->getAttribute('class'), 'key')) {
$params['key'] = $vcard_element->textContent;
$targets_left = self::popScrapeTarget($targets, 'key');
}
if (self::attributeContains($vcard_element->getAttribute('class'), 'locality')) {
$params['locality'] = $vcard_element->textContent;
$targets_left = self::popScrapeTarget($targets, 'locality');