When you insert a url with greek characters you get a not valid url message.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sotiris’s picture

Ok if we add the following at link.module @ line 29, we have greek letter validation.

       "Α", // A
    "Β",  //Β
    "Γ", //Γ
    "Δ", //Δ
    "Ε", //Ε
	"Ζ", //Ζ
	"Η", //Η
	"Θ", //Θ
	"Ι", //Ι
	"Κ", //Κ
	"Λ", //Λ
	"Μ", //Μ
	"Ν", //Ν
	"Ξ", //Ξ
	"Ο", //Ο
	"Π", //Π
	"Ρ", //Ρ
	"Σ", //Σ
	"Τ", //Τ
	"Υ", //Υ
	"Φ", //Φ
	"Χ", //Χ
	"Ψ", //Ψ
	"Ω", //Ω
	"α", //α
	"β", //β
	"γ", //γ
	"δ", //δ
	"ε", //ε
	"ζ", //ζ
	"η", //η
	"θ", //θ
	"ι", //ι
	"κ", //κ
	"λ", //λ
	"μ", //μ
	"ν",//ν
	"ξ", //ξ
	"ο", //ο
	"π", //π
	"ρ", //ρ
	"ς", //ς
	"σ", //σ
	"τ", //τ
	"υ", //υ
	"φ", //φ
	"χ", //χ
	"ψ", //ψ
	"ω", //ω
	"ϑ", //ϑ
	"ϒ", //ϒ
	"ϖ", //ϖ
	"Ά", // Ά
	"·", //GREEK ANO TELEIA
	"Έ", // Έ
	"Ή", // 'Η
	"Ί", // 'Ι
	"Ό", // Ό
	"Ύ", // 'Υ
	"Ώ", // 'Ω
	"ΐ", // ΐ
	"Ϊ", // Ϊ
	"Ϋ", // Ϋ
	"ά", // ά
	"έ", // έ
	"ή", // ή
	"ό", // ό
	"ί", // ί
	"ΰ", // ΰ
	"ϊ", // ϊ
	"ϋ", // ϋ
	"ό", // ό
	"ύ", // ύ
	"ώ", // ώ
jcfiala’s picture

Assigned: Unassigned » jcfiala

Oh, wow! That's *just* what I needed. Thank you *so* much! I'll get that into the code this weekend.

Any chance you could throw in a couple of urls which currently fail that I could use in tests?

sotiris’s picture

You're welcome!

Urls with greek characters:
http://mydrupal.gr/η-αμερικάνικη-κυβέρνηση-επιλέγει-drupal
http://mydrupal.gr/το-drupal-αναδείχτηκε-το-καλύτερο-php-cms-ανοικτού-κώδικα-2008
http://el.wikipedia.org/wiki/Εγκυκλοπαίδεια
http://el.wikipedia.org/wiki/Τεχνολογία
http://el.wikipedia.org/wiki/Πύλη:Υπολογιστές

GiorgosK’s picture

Status: Active » Needs review
FileSize
1.84 KB

Here is a patch against dev version

it seems to work but needs some more testing

apanag’s picture

Hello GiorgosK,

i tested your patch and the system rejected it.

patch < link_greek_characters.patch 
(Stripping trailing CRs from patch.)
patching file link.module
Hunk #1 FAILED at 26.
1 out of 1 hunk FAILED -- saving rejects to file link.module.rej
GiorgosK’s picture

FileSize
29.39 KB

I am patching in windows environment using
patch -p0 < link_greek_characters.patch --binary

tried it again it patches cleanly with no error messages
only with CRs (Stripping trailing CRs from patch.)

here is the modified module as well

apanag’s picture

I used your modified module and it worked as expected.
Thank you very much.

GiorgosK’s picture

Status: Needs review » Reviewed & tested by the community

3/3 testers confirmed this to work

jcfiala’s picture

I'm starting to think that this method of adding allowable characters could lead to performance problems, so I'm stepping back to consider how better to allow valid unicode characters without including symbols that don't belong in urls. I welcome suggestions on how to handle this with regex!

If folks want to continue to patch their own copies of the code, they'll need to re-roll the patch because I"ve changed how the unicode characters are handled because of problems with PHP4.

GiorgosK’s picture

New patch for 2.9 version

@jcfiala
how about using something like this
http://www.geekology.co.za/blog/2009/03/validating-sanitizing-urls-email...
http://www.php.net/filter_var
(available from php5)

jcfiala’s picture

Status: Reviewed & tested by the community » Needs work

Hm. Problem with using filter_var is that Drupal 6.x still supports some varieties of php 4.x.

That said, it's certainly an idea for the 7.x branch.

dqd’s picture

Assigned: jcfiala » Unassigned
Status: Needs work » Closed (duplicate)
Issue tags: +field validation

Dear followers of this issue: please read the project page info of link module for the further way to go for URL validation issues. There is already an main issue to collect and discuss ALL possible validation scenarios in general. That's why I will mark this one here as duplicate. I need all concentration inside the ONE and only discussion to move forward. After a D7 implementation we will provide a D6 backport.

Explanation: There are too many corner cases and URL validation feature requests of users to implement them all one after the other. We would have a 40 inüut fields and checkbox lines cluttered settings form for URL validation methods only, conflicting with each other randomly. I think, the better way is to find a maybe more complex but all-embracing new configuration method, which lets the admin better decide, how and when to validate the url. Including a good description which helps to set it up. This will surely lead to a new branch

GiorgosK’s picture

Version: 6.x-2.x-dev » 7.x-1.x-dev
FileSize
1.91 KB

for now I am using this patch for drupal 7 but hoping the linked issue gets implements