Allow for short versions in Deprecation::notification_version()

This commit is contained in:
Ingo Schommer 2013-03-22 13:30:54 +01:00
parent 183396a8ab
commit f55bd9d3af

View File

@ -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])) {