From fa2ac3baf480bfc2d1d056042145274f366395d5 Mon Sep 17 00:00:00 2001 From: brettp Date: Sun, 20 Feb 2011 18:52:21 +0000 Subject: Refs #2749, #2956. Merged elgg_depracated_notice() fixes to trunk. git-svn-id: http://code.elgg.org/elgg/trunk@8364 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 6348d8c01..8b8cc16df 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -1060,33 +1060,30 @@ function elgg_dump($value, $to_screen = TRUE, $level = 'NOTICE') { */ function elgg_deprecated_notice($msg, $dep_version) { // if it's a major release behind, visual and logged - // if it's a 2 minor releases behind, visual and logged - // if it's 1 minor release behind, logged. + // if it's a 1 minor release behind, visual and logged + // if it's for current minor release, logged. // bugfixes don't matter because you're not deprecating between them, RIGHT? + if (!$dep_version) { return FALSE; } $elgg_version = get_version(TRUE); $elgg_version_arr = explode('.', $elgg_version); - $elgg_major_version = $elgg_version_arr[0]; - $elgg_minor_version = $elgg_version_arr[1]; - - $dep_version_arr = explode('.', $dep_version); - $dep_major_version = $dep_version_arr[0]; - $dep_minor_version = $dep_version_arr[1]; + $elgg_major_version = (int)$elgg_version_arr[0]; + $elgg_minor_version = (int)$elgg_version_arr[1]; - $last_working_version = $dep_minor_version - 1; + $dep_major_version = (int)$dep_version; + $dep_minor_version = 10 * ($dep_version - $dep_major_version); $visual = FALSE; - // use version_compare to account for 1.7a < 1.7 - if (($dep_major_version < $elgg_major_version) - || (($elgg_minor_version - $last_working_version) > 1)) { + if (($dep_major_version < $elgg_major_version) || + ($dep_minor_version < $elgg_minor_version)) { $visual = TRUE; } - $msg = "Deprecated in $dep_version: $msg"; + $msg = "Deprecated in $dep_major_version.$dep_minor_version: $msg"; if ($visual) { register_error($msg); -- cgit v1.2.3