[GH-ISSUE #481] Special Characters in urls #783

Closed
opened 2026-03-15 15:27:17 +03:00 by kerem · 6 comments
Owner

Originally created by @TimWeyand on GitHub (Jul 26, 2024).
Original GitHub issue: https://github.com/flyimg/flyimg/issues/481

Originally assigned to: @sadok-f on GitHub.

Describe the bug
If the source image has a special character in the url, the operation results in an Exception in /src/Core/Entity/Image/InputImage.php:114 . Its technically not wanted to have special characters like a space, but non technical personal, sometimes upload it anyways

To Reproduce
load an image with an special character like %20 (space). In php it will be converted to " ", which causes the error.

Expected behavior
parts of the url previously url encoded, should be url encoded on the way out.

Originally created by @TimWeyand on GitHub (Jul 26, 2024). Original GitHub issue: https://github.com/flyimg/flyimg/issues/481 Originally assigned to: @sadok-f on GitHub. **Describe the bug** If the source image has a special character in the url, the operation results in an Exception in /src/Core/Entity/Image/InputImage.php:114 . Its technically not wanted to have special characters like a space, but non technical personal, sometimes upload it anyways **To Reproduce** load an image with an special character like %20 (space). In php it will be converted to " ", which causes the error. **Expected behavior** parts of the url previously url encoded, should be url encoded on the way out.
kerem 2026-03-15 15:27:17 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@sadok-f commented on GitHub (Jul 26, 2024):

Thank you @TimWeyand for reporting this issue.
I'll check it out and get back to you.

<!-- gh-comment-id:2252812499 --> @sadok-f commented on GitHub (Jul 26, 2024): Thank you @TimWeyand for reporting this issue. I'll check it out and get back to you.
Author
Owner

@sadok-f commented on GitHub (Jul 28, 2024):

Hi @TimWeyand could you please provide more details about the issue?
Ideally, it should be a concrete example of an image URL with a special character.
Flyimg should handle URL encoded source images, as some source endpoint require some parameters.
Here my testing of a local image with space encoded (%20):
image

<!-- gh-comment-id:2254458733 --> @sadok-f commented on GitHub (Jul 28, 2024): Hi @TimWeyand could you please provide more details about the issue? Ideally, it should be a concrete example of an image URL with a special character. Flyimg should handle URL encoded source images, as some source endpoint require some parameters. Here my testing of a local image with space encoded (%20): ![image](https://github.com/user-attachments/assets/a3d5c8d5-13e0-4c26-8442-46c7fb36b7e3)
Author
Owner

@TimWeyand commented on GitHub (Jul 28, 2024):

Hi @sadok-f,
thank you for checking this issue! 🙂

Here are three examples (one working control - two not working examples):

Working request:
control:

curl -I https://cdn.klambt.services/_trash/testing/screen/flyimg/controll.png

HTTP/2 200
last-modified: Sun, 28 Jul 2024 14:29:21 GMT
etag: "c2ef0c5cc7449d3b9c0731cca17d0132"
content-type: image/png
accept-ranges: bytes
removed headers

flyimg:

curl -I https://demo.flyimg.io/upload/q_85/https://cdn.klambt.services/_trash/testing/screen/flyimg/controll.png
HTTP/2 200
date: Sun, 28 Jul 2024 14:30:38 GMT
content-type: image/avif
content-length: 158431
cache-control: public, max-age=31536000, s-maxage=31536000
removed headers

Just Spaces (failed) request:
control:

curl -I https://cdn.klambt.services/_trash/testing/screen/flyimg/Bildschirmfoto%202024%2007%2028%20um%2015%2046%2028.png
HTTP/2 200
last-modified: Sun, 28 Jul 2024 13:50:03 GMT
etag: "c2ef0c5cc7449d3b9c0731cca17d0132"
content-type: image/png
accept-ranges: bytes
removed headers

flyimg:

curl -I https://demo.flyimg.io/upload/q_85/https://cdn.klambt.services/_trash/testing/screen/flyimg/Bildschirmfoto%202024%2007%2028%20um%2015%2046%2028.png
HTTP/2 500
date: Sun, 28 Jul 2024 14:34:13 GMT
content-type: text/html; charset=UTF-8
cache-control: private, must-revalidate
pragma: no-cache
removed headers

Just weird filename:
control:

curl -I https://cdn.klambt.services/_trash/testing/screen/flyimg/justwéird-śtüff.png
HTTP/2 200
last-modified: Sun, 28 Jul 2024 14:28:44 GMT
etag: "c2ef0c5cc7449d3b9c0731cca17d0132"
content-type: image/png
accept-ranges: bytes
age: 117
date: Sun, 28 Jul 2024 14:37:53 GMT

flyimg:

curl -I https://demo.flyimg.io/upload/q_85/https://cdn.klambt.services/_trash/testing/screen/flyimg/justwéird-śtüff.png
HTTP/2 500
date: Sun, 28 Jul 2024 14:40:55 GMT
content-type: text/html; charset=UTF-8
cache-control: private, must-revalidate
pragma: no-cache
expires: -1
cf-cache-status: BYPASS
removed headers

<!-- gh-comment-id:2254543389 --> @TimWeyand commented on GitHub (Jul 28, 2024): Hi @sadok-f, thank you for checking this issue! 🙂 Here are three examples (one working control - two not working examples): Working request: control: > curl -I https://cdn.klambt.services/_trash/testing/screen/flyimg/controll.png > > HTTP/2 200 > last-modified: Sun, 28 Jul 2024 14:29:21 GMT > etag: "c2ef0c5cc7449d3b9c0731cca17d0132" > content-type: image/png > accept-ranges: bytes > *removed headers* flyimg: > curl -I https://demo.flyimg.io/upload/q_85/https://cdn.klambt.services/_trash/testing/screen/flyimg/controll.png > HTTP/2 200 > date: Sun, 28 Jul 2024 14:30:38 GMT > content-type: image/avif > content-length: 158431 > cache-control: public, max-age=31536000, s-maxage=31536000 > *removed headers* Just Spaces (failed) request: control: > curl -I https://cdn.klambt.services/_trash/testing/screen/flyimg/Bildschirmfoto%202024%2007%2028%20um%2015%2046%2028.png > HTTP/2 200 > last-modified: Sun, 28 Jul 2024 13:50:03 GMT > etag: "c2ef0c5cc7449d3b9c0731cca17d0132" > content-type: image/png > accept-ranges: bytes > *removed headers* flyimg: > curl -I https://demo.flyimg.io/upload/q_85/https://cdn.klambt.services/_trash/testing/screen/flyimg/Bildschirmfoto%202024%2007%2028%20um%2015%2046%2028.png > HTTP/2 500 > date: Sun, 28 Jul 2024 14:34:13 GMT > content-type: text/html; charset=UTF-8 > cache-control: private, must-revalidate > pragma: no-cache > *removed headers* Just weird filename: control: > curl -I https://cdn.klambt.services/_trash/testing/screen/flyimg/justwéird-śtüff.png > HTTP/2 200 > last-modified: Sun, 28 Jul 2024 14:28:44 GMT > etag: "c2ef0c5cc7449d3b9c0731cca17d0132" > content-type: image/png > accept-ranges: bytes > age: 117 > date: Sun, 28 Jul 2024 14:37:53 GMT flyimg: > curl -I https://demo.flyimg.io/upload/q_85/https://cdn.klambt.services/_trash/testing/screen/flyimg/justwéird-śtüff.png > HTTP/2 500 > date: Sun, 28 Jul 2024 14:40:55 GMT > content-type: text/html; charset=UTF-8 > cache-control: private, must-revalidate > pragma: no-cache > expires: -1 > cf-cache-status: BYPASS > *removed headers*
Author
Owner

@TimWeyand commented on GitHub (Aug 5, 2024):

@sadok-f I have added an (unpretty) method to rawurlencode() parts of the url which could cause problems.

<!-- gh-comment-id:2269231116 --> @TimWeyand commented on GitHub (Aug 5, 2024): @sadok-f I have added an (unpretty) method to rawurlencode() parts of the url which could cause problems.
Author
Owner

@sadok-f commented on GitHub (Aug 12, 2024):

Sorry @TimWeyand for not answering you, I'm currently on vacation until the end of August.
As soon as I get back I will check it out.
Thank you.

<!-- gh-comment-id:2283215245 --> @sadok-f commented on GitHub (Aug 12, 2024): Sorry @TimWeyand for not answering you, I'm currently on vacation until the end of August. As soon as I get back I will check it out. Thank you.
Author
Owner

@sadok-f commented on GitHub (Aug 27, 2024):

fixed in #483

<!-- gh-comment-id:2311839516 --> @sadok-f commented on GitHub (Aug 27, 2024): fixed in #483
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/flyimg#783
No description provided.