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
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.