Skip to content

Commit ad3f78f

Browse files
committed
use ibb instead of imgur
1 parent a0b874d commit ad3f78f

File tree

6 files changed

+26
-5
lines changed

6 files changed

+26
-5
lines changed

config/django/prod.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
"data:",
100100
"https://*.giphy.com",
101101
"https://*.tenor.com",
102-
"https://*.imgur.com",
102+
"https://*.ibb.co",
103103
"https://static.mahmoudashraf.dev",
104104
"https://www.gravatar.com",
105105
],
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Generated by Django 6.0.2 on 2026-02-17 15:15
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("guestbook", "0014_guestbookformpage_tags_guestbookindexpage_tags"),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name="guestbook",
15+
name="message",
16+
field=models.TextField(
17+
help_text="Supports basic Markdown and HTML. Max 2000 characters. GIFs allowed from giphy/tenor/imgbb.",
18+
max_length=2000,
19+
),
20+
),
21+
]

src/guestbook/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class Visibility(models.TextChoices):
8989
max_length=2000,
9090
help_text=(
9191
"Supports basic Markdown and HTML. Max 2000 characters. "
92-
"GIFs allowed from giphy/tenor/imgur."
92+
"GIFs allowed from giphy/tenor/imgbb."
9393
),
9494
)
9595
message_html = models.TextField(blank=True, null=True)

src/guestbook/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def allow_src(_, name, value):
1818
return True
1919
if name == "src":
2020
p = urlparse(value)
21-
allowed_domains = (".giphy.com", ".tenor.com", ".imgur.com")
21+
allowed_domains = (".giphy.com", ".tenor.com", ".ibb.co")
2222
return not p.netloc or any(p.netloc.endswith(domain) for domain in allowed_domains)
2323

2424
return False

src/resources/js/guestbook-editor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const allowedTags = [
3030
'img',
3131
];
3232

33-
const allowedImgDomains = ['.giphy.com', '.tenor.com', '.imgur.com'];
33+
const allowedImgDomains = ['.giphy.com', '.tenor.com', '.ibb.co'];
3434
const allowedAttrs = ['src', 'alt', 'height', 'width'];
3535

3636
DOMPurify.addHook('uponSanitizeAttribute', (node, data) => {

src/templates/guestbook/guestbook_index_page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{% block head %}
55
<link rel="dns-prefetch" href="//giphy.com">
66
<link rel="dns-prefetch" href="//tenor.com">
7-
<link rel="dns-prefetch" href="//imgur.com">
7+
<link rel="dns-prefetch" href="//i.ibb.co">
88
{% endblock head %}
99

1010
{% block content %}

0 commit comments

Comments
 (0)