Remove validity check on profile key parameter

This commit is contained in:
Hypolite Petovan 2020-09-26 16:33:29 -04:00
parent ffa16d1935
commit c8fa6ef3dc
2 changed files with 1 additions and 8 deletions

View file

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

View file

@ -129,7 +129,7 @@ class Scrape
$nodes_left = max(intval($max_nodes), $minNodes); $nodes_left = max(intval($max_nodes), $minNodes);
$items = $dom->getElementsByTagName('*'); $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); $targets_left = count($targets);
foreach ($items as $item) { foreach ($items as $item) {
if (self::attributeContains($item->getAttribute('class'), 'vcard')) { if (self::attributeContains($item->getAttribute('class'), 'vcard')) {
@ -147,10 +147,6 @@ class Scrape
$params['photo'] = $vcard_element->getAttribute('src'); $params['photo'] = $vcard_element->getAttribute('src');
$targets_left = self::popScrapeTarget($targets, 'photo'); $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')) { if (self::attributeContains($vcard_element->getAttribute('class'), 'locality')) {
$params['locality'] = $vcard_element->textContent; $params['locality'] = $vcard_element->textContent;
$targets_left = self::popScrapeTarget($targets, 'locality'); $targets_left = self::popScrapeTarget($targets, 'locality');