Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-63967

Deprecated some flags using FILTER_VALIDATE_URL

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.6.3
    • 3.6, 3.7
    • General
    • MOODLE_36_STABLE, MOODLE_37_STABLE
    • MOODLE_36_STABLE
    • Hide

      With all supported PHP versions (7.1, 7.2 and 7.3):

      1. Copy the attached verify_filter_var.php to the root dir of your Moodle installation.

      2. Run it via cli: php verify_filter_var.php

      3. Verify that you get an Ok! without any PHP warning or notice.

      Show
      With all supported PHP versions (7.1, 7.2 and 7.3): 1. Copy the attached verify_filter_var.php to the root dir of your Moodle installation. 2. Run it via cli: php verify_filter_var.php 3. Verify that you get an Ok! without any PHP warning or notice.

      The explicit usage of the constants FILTER_FLAG_SCHEME_REQUIRED and
      FILTER_FLAG_HOST_REQUIRED is now deprecated; both are implied for
      FILTER_VALIDATE_URL anyway.

      We have 2 uses of this is core:

      lib/typo3/class.t3lib_div.php
      1530:		return (filter_var($IDN->encode($url), FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED) !== FALSE);
       
      lib/phpmailer/src/PHPMailer.php
      3581:        if (filter_var('http://' . $host, FILTER_VALIDATE_URL, FILTER_FLAG_HOST_REQUIRED)) {
      

      Need to see if it's reachable code and get rid of the deprecated flags (since 5.2!) to avoid this added PHP Deprecated warning:

      PHP Deprecated:  filter_var(): explicit use of FILTER_FLAG_SCHEME_REQUIRED and FILTER_FLAG_HOST_REQUIRED is deprecated in xxxx
      

            stronk7 Eloy Lafuente (stronk7)
            stronk7 Eloy Lafuente (stronk7)
            Mark Nelson Mark Nelson
            Jun Pataleta Jun Pataleta
            Anna Carissa Sadia Anna Carissa Sadia
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 15 minutes
                15m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.