forked from friendica/friendica-directory
Remove validity check on profile key parameter
This commit is contained in:
parent
ffa16d1935
commit
c8fa6ef3dc
|
@ -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++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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');
|
||||||
|
|
Loading…
Reference in a new issue