MDL-52279 core_lib: Remove php4 style constructor
authorRajesh Taneja <rajesh@moodle.com>
Tue, 24 Nov 2015 08:24:24 +0000 (16:24 +0800)
committerRajesh Taneja <rajesh@moodle.com>
Mon, 30 Nov 2015 03:25:55 +0000 (11:25 +0800)
filterobject is called from core and as it's
using php4 style constructor, global USER is
not set properly because of deprecation warning

lib/filterlib.php

index ba89fd2..0c23431 100644 (file)
@@ -463,7 +463,7 @@ class filterobject {
      * @param bool $fullmatch
      * @param mixed $replacementphrase
      */
-    function filterobject($phrase, $hreftagbegin = '<span class="highlight">',
+    public function __construct($phrase, $hreftagbegin = '<span class="highlight">',
                                    $hreftagend = '</span>',
                                    $casesensitive = false,
                                    $fullmatch = false,