[RSS Feed/News] XF\Validator\Url::coerceValue does not apply schema for non-www URLs

Status
Not open for further replies.

XenForo

Administrative
  • Thread starter
  • Admin
  • #1
Problem:
When using the XF\Validator\Url class to validate URLs, entering a non-www URL does not correctly apply the schema.

Test Cases:
https://google.com works.
www.google.com works.
google.com does not, and asks to input a valid URL.

Suggested Fix:
Apply the following below else if (substr(strtolower($value), 0, 4) == 'www.')
PHP:

Code:
        else
        {
            $scheme = parse_url($value, PHP_URL_SCHEME);
            if ($scheme...

Read more

ادامه مطلب...
 
Status
Not open for further replies.
Back
Top Bottom