php / php/php-src

FILTER_VALIDATE_URL returns false when latin chars (šđčćž) present in URL

Open
#17,925 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Extension: filter Feature
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

It's been a few years since latin chars are supported in domain names, and urls.

Description

The following code:

<?php var_dump(filter_var('info@ćufta.com', FILTER_VALIDATE_EMAIL));?>

Resulted in this output:

FALSE

But I expected this output instead:

TRUE
PHP Version

PHP 8.3.17

Operating System

Ubuntu Mint - Linux 5.4.0-208-generic #228-Ubuntu SMP Fri Feb 7 19:41:33 UTC 2025 x86_64

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the supplied filter_var example with FILTER_VALIDATE_EMAIL and compare it with the issue title, which refers to FILTER_VALIDATE_URL. Trace the relevant PHP filter validation entry point and existing tests for internationalized email or URL characters. Done means the intended validation behavior is agreed and covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.