We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Valid URL plugin fix

Development and Programming

Derek Hogue's avatar
Derek Hogue
316 posts
16 years ago
Derek Hogue's avatar Derek Hogue

I use the Valid URL plugin quite extensively, as I always find that clients have no idea that http:// is required to make URLs actually work. I just found a bug in it this weekend though, when a client of mine entered a URL into a validated field which contained a fragment identifier/hash mark. Because of how the plugin disassembled and then reassembled URLs, the hash gets stripped, breaking the URL.

The fix is to add the following to line 79 of pi.valid_url.php:

case 'fragment':
$url[$key] = '#' . urlencode(str_replace(array_keys($protected), $protected, $value));
break;

I’ve notified Justin at EllisLab about the fix, but I thought I’d post it here for anyone using the plugin to see, so as to avoid their URL validation from actually invalidating their URLs. 😊

Best, Derek

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.