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

Missing preg_quote() @ instaclick/php-webdriver leads to PHP 7.3 PCRE2 failures

XMLWordPrintable

    • MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • MOODLE_36_STABLE, MOODLE_37_STABLE
    • Hide

      Verify that phpunit and behat tests are passing or @ https://ci.moodle.org and, if there is any error it is not caused by the PHP 7.3 PCRE (preg_replace()) compatibility warning described in this issue.

      Show
      Verify that phpunit and behat tests are passing or @ https://ci.moodle.org and, if there is any error it is not caused by the PHP 7.3 PCRE (preg_replace()) compatibility warning described in this issue.

      Working on the 3.7 release testing matrix it was detected that a lot of behat tests were failing against FF 47.0.1 (marionette = false) under PHP 7.3. With error:

      Warning: preg_replace(): Compilation failed: number too big in {} quantifier at offset 6
      

      Tracing the problem down, it seems that an apparently innocent preg_replace() is being used to match elements and it's missing any quoting... so the real literals are not being searched. PHP 7.3 warned us, because now (PCRE2) it's pickier... but it may be a problem also for previous versions leading to non-matches depending of the strings being searched.

      So this PR was created: https://github.com/instaclick/php-webdriver/pull/91

      A complete run with the patch applied ended ok (no more PCRE2 failures). Note that some of the failures are the usual Firefox "focus" ones (I ran it locally), and via --rerun they ended passing.

      https://pastebin.com/EVtR3qV4

      This issue is to:

      1) trace that upstream PR (https://github.com/instaclick/php-webdriver/pull/91 )
      2) see if we can incorporate it to our machinery in the mean time, so we get FF 47.0.1 (marionette = false) back to pass.

      Ciao

            stronk7 Eloy Lafuente (stronk7)
            stronk7 Eloy Lafuente (stronk7)
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Andrew Lyons Andrew Lyons
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 30 minutes
                4h 30m

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