From a52ed03b49b8f62573eb3e295bfde84d1ef68f46 Mon Sep 17 00:00:00 2001 From: Daniel Hensby Date: Fri, 2 Jun 2017 12:22:33 +0100 Subject: [PATCH 1/3] FIX Upgrade old style constructors that were missed --- dev/Profiler.php | 2 +- parsers/HTML/HTMLBBCodeParser.php | 2 +- thirdparty/tinymce-spellchecker/classes/SpellChecker.php | 2 +- thirdparty/tinymce-spellchecker/classes/utils/JSON.php | 4 ++-- thirdparty/tinymce-spellchecker/classes/utils/Logger.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dev/Profiler.php b/dev/Profiler.php index 99c46e5d7..435c553bb 100644 --- a/dev/Profiler.php +++ b/dev/Profiler.php @@ -32,7 +32,7 @@ class Profiler { /** * Initialise the timer. with the current micro time */ - public function Profiler( $output_enabled=false, $trace_enabled=false) + public function __construct( $output_enabled=false, $trace_enabled=false) { $this->description = array(); $this->startTime = array(); diff --git a/parsers/HTML/HTMLBBCodeParser.php b/parsers/HTML/HTMLBBCodeParser.php index 177cd253c..f113e23ee 100644 --- a/parsers/HTML/HTMLBBCodeParser.php +++ b/parsers/HTML/HTMLBBCodeParser.php @@ -136,7 +136,7 @@ class SSHTMLBBCodeParser * @access public * @author Stijn de Reede */ - public function SSHTMLBBCodeParser($options = array()) + public function __construct($options = array()) { // set the already set options $baseoptions = &SSHTMLBBCodeParser::getStaticProperty('SSHTMLBBCodeParser', '_options'); diff --git a/thirdparty/tinymce-spellchecker/classes/SpellChecker.php b/thirdparty/tinymce-spellchecker/classes/SpellChecker.php index b31da4b41..2f269c48c 100644 --- a/thirdparty/tinymce-spellchecker/classes/SpellChecker.php +++ b/thirdparty/tinymce-spellchecker/classes/SpellChecker.php @@ -13,7 +13,7 @@ class SpellChecker { * * @param $config Configuration name/value array. */ - function SpellChecker(&$config) { + function __construct(&$config) { $this->_config = $config; } diff --git a/thirdparty/tinymce-spellchecker/classes/utils/JSON.php b/thirdparty/tinymce-spellchecker/classes/utils/JSON.php index 1c4611676..d095258b7 100644 --- a/thirdparty/tinymce-spellchecker/classes/utils/JSON.php +++ b/thirdparty/tinymce-spellchecker/classes/utils/JSON.php @@ -29,7 +29,7 @@ class Moxiecode_JSONReader { var $_location, $_lastLocations; var $_needProp; - function Moxiecode_JSONReader($data) { + function __construct($data) { $this->_data = $data; $this->_len = strlen($data); $this->_pos = -1; @@ -360,7 +360,7 @@ class Moxiecode_JSONReader { * @package MCManager.utils */ class Moxiecode_JSON { - function Moxiecode_JSON() { + function __construct() { } function decode($input) { diff --git a/thirdparty/tinymce-spellchecker/classes/utils/Logger.php b/thirdparty/tinymce-spellchecker/classes/utils/Logger.php index e2a64069c..2c3faec4e 100644 --- a/thirdparty/tinymce-spellchecker/classes/utils/Logger.php +++ b/thirdparty/tinymce-spellchecker/classes/utils/Logger.php @@ -31,7 +31,7 @@ class Moxiecode_Logger { /** * Constructs a new logger instance. */ - function Moxiecode_Logger() { + function __construct() { $this->_path = ""; $this->_filename = "{level}.log"; $this->setMaxSize("100k"); From 23052556992b0ace9b9dfbe669dd748d8f067698 Mon Sep 17 00:00:00 2001 From: Jacob Buck Date: Mon, 5 Jun 2017 15:17:37 +1200 Subject: [PATCH 2/3] Add `updateURL` extension hook to `File::getURL` --- filesystem/File.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/filesystem/File.php b/filesystem/File.php index f6aca1d1f..9711de1c4 100644 --- a/filesystem/File.php +++ b/filesystem/File.php @@ -719,7 +719,8 @@ class File extends DataObject { * @return string */ public function getURL() { - return Controller::join_links(Director::baseURL(), $this->getFilename()); + $url = Controller::join_links(Director::baseURL(), $this->getFilename()); + return $this->extend('updateURL', $url); } /** From 92b734120037589194c1b7dc671ccada86193b79 Mon Sep 17 00:00:00 2001 From: Jacob Date: Tue, 6 Jun 2017 13:38:11 +1200 Subject: [PATCH 3/3] Call `$this->extend('updateURL', $url);` befor returning `$url` --- filesystem/File.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/filesystem/File.php b/filesystem/File.php index 9711de1c4..801c52dba 100644 --- a/filesystem/File.php +++ b/filesystem/File.php @@ -720,7 +720,8 @@ class File extends DataObject { */ public function getURL() { $url = Controller::join_links(Director::baseURL(), $this->getFilename()); - return $this->extend('updateURL', $url); + $this->extend('updateURL', $url); + return $url; } /**