Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homepage verification inconsistent? #12507

Closed
SpcCw opened this issue Dec 22, 2022 · 5 comments · Fixed by #12513
Closed

Homepage verification inconsistent? #12507

SpcCw opened this issue Dec 22, 2022 · 5 comments · Fixed by #12513
Assignees
Labels
Bug Junior Jobs These are issues we think are good for starting to work with the Friendica code base
Milestone

Comments

@SpcCw
Copy link

SpcCw commented Dec 22, 2022

Some links don't seem to pass verification procedure and checkmark doesn't appear.

Test profile:
https://friends.deko.cloud/profile/bot

Link examples:
https://social.deko.cloud/test.html - passes verification
https://lor.sh/@shuro - doesn't pass verification

When the second link is set in the profile the following is registered in the log:

2022-12-22T16:42:31Z worker [INFO]: Process start. {"priority":30,"id":61906637,"worker_id":"0677fea","worker_cmd":"CheckRelMeProfileLink"} - {"file":"Worker.php","line":554,"function":"execFunction","uid":"cf1176","process_id":1321120}
2022-12-22T16:42:31Z worker [NOTICE]: Verifying the homepage {"uid":2,"worker_id":"0677fea","worker_cmd":"CheckRelMeProfileLink"} - {"file":"CheckRelMeProfileLink.php","line":57,"function":"execute","uid":"cf1176","process_id":1321120}
2022-12-22T16:42:31Z worker [NOTICE]: Homepage URL could not be verified {"uid":2,"owner homepage":"https://lor.sh/@shuro","worker_id":"0677fea","worker_cmd":"CheckRelMeProfileLink"} - {"file":"CheckRelMeProfileLink.php","line":88,"function":"execute","uid":"cf1176","process_id":1321120}
2022-12-22T16:42:31Z worker [INFO]: ID 61906637: CheckRelMeProfileLink {"action":"profiling","database_read":0,"database_write":0,"cache_read":0,"cache_write":0,"network_io":0,"file_io":0,"other_io":0.17,"total":0.17} - {"file":"Worker.php","line":627,"function":"execFunction","uid":"cf1176","process_id":1321120}
2022-12-22T16:42:31Z worker [INFO]: ID 61906637: CheckRelMeProfileLink:  {"action":"profiling"} - {"file":"Worker.php","line":627,"function":"execFunction","uid":"cf1176","process_id":1321120}

However if I curl links they seem to be okay except minor syntax differences:

curl https://social.deko.cloud/test.html | grep bot
<a href="https://friends.deko.cloud/profile/bot" rel="me">test</a>
100<link href='https://friends.deko.cloud/profile/bot' rel='me' type='text/html'>

Another example with another profile and link:

curl  https://ro.gravatar.com/cata195  | grep libra
<a class="profile-link" href="https://libranet.de/profile/petrescatraian" target="_blank" rel="me nofollow noopener">libranet.de/profile/petrescatraian</a>
@SpcCw SpcCw added the Bug label Dec 22, 2022
@MrPetovan
Copy link
Collaborator

I just checked and we don't expect any other terms in the rel attribute, which explains the failed verification.

This check needs to first split the $rel value on spaces, and then check that the me value is present in the resulting list:

$rel = $link->getAttribute('rel');
if ($rel == 'me') {

@MrPetovan MrPetovan added the Junior Jobs These are issues we think are good for starting to work with the Friendica code base label Dec 22, 2022
@MrPetovan MrPetovan added this to the 2023.03 milestone Dec 22, 2022
@tobiasd
Copy link
Collaborator

tobiasd commented Dec 22, 2022

Also additionally to the <a> tags, apparently some people like to use a <link> tag, so to process should be done for both possible tags.

@MrPetovan
Copy link
Collaborator

MrPetovan commented Dec 22, 2022

Indeed, and this is the XPath query needed for this: //*[contains(concat(' ',normalize-space(@rel),' '),' me ')][contains(@href, 'https://example.com')]

@MrPetovan
Copy link
Collaborator

@SpcCw Please try again at your earliest convenience!

@SpcCw
Copy link
Author

SpcCw commented Dec 24, 2022

@MrPetovan - seems to work! Both link attribute and rel with multiple values pass the check. Big thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Junior Jobs These are issues we think are good for starting to work with the Friendica code base
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants