Make WordPress Core

Ticket #44944: 44944.patch

File 44944.patch, 1.0 KB (added by ayeshrajans, 6 years ago)

This is due to PHP 7.3 deprecating this approach. Attaching a patch for this one and one more use in phpunit utils.php.

  • src/wp-includes/pomo/plural-forms.php

    diff --git a/src/wp-includes/pomo/plural-forms.php b/src/wp-includes/pomo/plural-forms.php
    index cabc807180..bdca6c2c08 100644
    a b protected function parse( $str ) { 
    207207                                                $span     = strspn( $str, self::NUM_CHARS, $pos );
    208208                                                $output[] = array( 'value', intval( substr( $str, $pos, $span ) ) );
    209209                                                $pos     += $span;
    210                                                 continue;
     210                                                continue 2;
    211211                                        }
    212212
    213213                                        throw new Exception( sprintf( 'Unknown symbol "%s"', $next ) );
  • tests/phpunit/includes/utils.php

    diff --git a/tests/phpunit/includes/utils.php b/tests/phpunit/includes/utils.php
    index 0a9c44ee7a..1aca2271da 100644
    a b function benchmark_pcre_backtracking( $pattern, $subject, $strategy ) { 
    498498                        case PREG_NO_ERROR:
    499499                                return $i;
    500500                        case PREG_BACKTRACK_LIMIT_ERROR:
    501                                 continue;
     501                                continue 2;
    502502                        case PREG_RECURSION_LIMIT_ERROR:
    503503                                trigger_error( 'PCRE recursion limit encountered before backtrack limit.' );
    504504                                return;