Skip to:
Content

bbPress.org


Ignore:
Timestamp:
12/12/2016 01:59:44 PM (7 years ago)
Author:
xknown
Message:

Branch 0.9: Fix PHP 7 compat issues w.r.t. the use of func_get_arg() and PHP 5.x constructors.

  • func_get_arg() returns the current (modified) value of the given argument. Let's make sure the code behaves the same.
  • Add PHP 5.x style constructors.
  • Use preg_match instead of eregi

See #3033

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.9/bb-includes/gettext.php

    r1363 r6160  
    102102     * @param boolean enable_cache Enable or disable caching of strings (default on)
    103103     */
    104     function gettext_reader($Reader, $enable_cache = true) {
     104    function __construct($Reader, $enable_cache = true) {
    105105        // If there isn't a StreamReader, turn on short circuit mode.
    106106        if (! $Reader || isset($Reader->error) ) {
     
    136136        $this->originals = $this->readint();
    137137        $this->translations = $this->readint();
     138    }
     139
     140    function gettext_reader($Reader, $enable_cache = true) {
     141        $this->__construct($Reader, $enable_cache);
    138142    }
    139143
     
    292296            }
    293297            $header .= "\n"; //make sure our regex matches
    294             if (eregi("plural-forms: ([^\n]*)\n", $header, $regs))
     298            if (preg_match("/plural-forms: ([^\n]*)\n/i", $header, $regs))
    295299                $expr = $regs[1];
    296300            else
Note: See TracChangeset for help on using the changeset viewer.