resurrectedstar
resurrectedstar

Reputation: 33

preg_replace(): The /e modifier is deprecated error

I am currently looking to fix a small section of NagiosQL that is giving me some depreciation errors, mainly

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback       instead in /srv/nagiosql/public_html/libraries/pear/HTML/Template/IT.php on line 1095

The block on line 1095 is

        return preg_replace(
        "#<!-- INCLUDE (.*) -->#ime",
        "\$this->getFile('\\1')",
        $content
    );

How can I fix this?

Upvotes: 0

Views: 1780

Answers (1)

Adrian Preuss
Adrian Preuss

Reputation: 3113

Use preg_replace_callback

return preg_replace_callback(
    "#<!-- INCLUDE (.*) -->#im",
    array($this, 'getFile'),
    $content
);

Upvotes: 5

Related Questions