mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-24 03:43:42 -08:00
ignore invalid og:image tag
This commit is contained in:
parent
5808301770
commit
32fa6583ec
1 changed files with 1 additions and 1 deletions
|
@ -211,7 +211,7 @@ def save_post(form, post: Post):
|
||||||
filename = opengraph.get('og:image') or opengraph.get('og:image:url')
|
filename = opengraph.get('og:image') or opengraph.get('og:image:url')
|
||||||
filename_for_extension = filename.split('?')[0] if '?' in filename else filename
|
filename_for_extension = filename.split('?')[0] if '?' in filename else filename
|
||||||
unused, file_extension = os.path.splitext(filename_for_extension)
|
unused, file_extension = os.path.splitext(filename_for_extension)
|
||||||
if file_extension.lower() in allowed_extensions:
|
if file_extension.lower() in allowed_extensions and not filename.startswith('/'):
|
||||||
file = url_to_thumbnail_file(filename)
|
file = url_to_thumbnail_file(filename)
|
||||||
if file:
|
if file:
|
||||||
file.alt_text = opengraph.get('og:title')
|
file.alt_text = opengraph.get('og:title')
|
||||||
|
|
Loading…
Add table
Reference in a new issue