Buttons display
-
Hi Sayful,
First of all, thanks for this great plugin and happy new year!
I’ve spent a couple of minutes to identify why my buttons do not appear in a HeroCarousel… That was because I was using anchors and relative paths in the “Button URL” field value.
Could you please improve your Validate::url() function to allow such values?Here is a code suggestion, working for me:
class Validate { /** * Check if url is valid as per RFC 2396 Generic Syntax or starting with an anchor or a relative path * * @param mixed $url The URL string. * * @return bool */ public static function url( $url ): bool { $url = filter_var($url, FILTER_SANITIZE_URL); return (bool) filter_var( $url, FILTER_VALIDATE_URL ) || preg_match("%^(#([a-z0-9-_]+)?|(\.{0,2}/)(\.{2}/)?+[a-z0-9#&~_\-\.\?\=/]+)$%i", $url); } [...] }
Modified file : /carousel-slider/includes/Supports/Validate.php
Many thanks.
Jean-Marc
- The topic ‘Buttons display’ is closed to new replies.