From f55bd9d3af506e6e23c042f9b51177d1b180e55b Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 22 Mar 2013 13:30:54 +0100 Subject: [PATCH] Allow for short versions in Deprecation::notification_version() --- dev/Deprecation.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dev/Deprecation.php b/dev/Deprecation.php index d673cb28f..0b2545d26 100644 --- a/dev/Deprecation.php +++ b/dev/Deprecation.php @@ -131,13 +131,14 @@ class Deprecation { // Never raise deprecation notices in a live environment if(Director::isLive()) return; - // If you pass #.#, assume #.#.0 - if(preg_match('/^[0-9]+\.[0-9]+$/', $atVersion)) $atVersion .= '.0'; - $checkVersion = self::$version; // Getting a backtrace is slow, so we only do it if we need it $backtrace = null; + // If you pass #.#, assume #.#.0 + if(preg_match('/^[0-9]+\.[0-9]+$/', $atVersion)) $atVersion .= '.0'; + if(preg_match('/^[0-9]+\.[0-9]+$/', $checkVersion)) $checkVersion .= '.0'; + if(self::$module_version_overrides) { $module = self::get_calling_module_from_trace($backtrace = debug_backtrace(0)); if(isset(self::$module_version_overrides[$module])) {