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

Fix description retrieval when page charset is not UTF-8 #1992

Merged
merged 1 commit into from Mar 1, 2024

Conversation

sokai
Copy link

@sokai sokai commented May 30, 2023

Added mb_convert_encoding() on $description + $tags, like $title

@nodiscc
Copy link
Member

nodiscc commented Jun 1, 2023

What issue does this fix?

@nodiscc nodiscc added bug it's broken! unconfirmed labels Jun 1, 2023
@sokai
Copy link
Author

sokai commented Jun 1, 2023

What issue does this fix?

Got no metadata while adding this link: https://www.scharferladen.de/kochmesser-shop/wuesthof-messer-solingen/ikon-classic-messer/wuesthof-classic-ikon-kochmesser-schwarz-20-cm.html to Shaarli (Demo link).

After checking the code I found that only the title string was converted with mb_convert_encoding(), so I added the conversion also to $description + $tags (and finally could get metadata from the above link). #fixeditforme

KR

@nodiscc nodiscc self-assigned this Jun 30, 2023
@nodiscc nodiscc added this to the 0.13.0 milestone Jun 30, 2023
@nodiscc nodiscc removed their assignment Jul 6, 2023
@nodiscc
Copy link
Member

nodiscc commented Oct 5, 2023

Thanks, I can reproduce this bug when Automatically retrieve description for new bookmarks is enabled in /admin/configure (when it is disabled, the HTML title alone is correctly retrieved). I will test this patch on my instance.

@sokai can you please rebase on top of master so that the CI runs again? Rebased

@nodiscc nodiscc changed the title Update MetadataRetriever.php Fix description retrieval when page charset is not UTF-8 Oct 5, 2023
@nodiscc nodiscc modified the milestones: 0.13.0, 0.14.0 Nov 22, 2023
Added `mb_convert_encoding()` on `$description` + `$tags`, like `$title`
@nodiscc nodiscc merged commit 7909448 into shaarli:master Mar 1, 2024
8 checks passed
@nodiscc nodiscc removed the in review label Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug it's broken!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants