diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-20 18:52:21 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-20 18:52:21 +0000 |
commit | fa2ac3baf480bfc2d1d056042145274f366395d5 (patch) | |
tree | 5dbe0ee0c1bcfed109b57ef6d9b6bbd0503cbec7 | |
parent | a773bddd6e7d5efb58de2bf2abb717125bb53330 (diff) | |
download | elgg-fa2ac3baf480bfc2d1d056042145274f366395d5.tar.gz elgg-fa2ac3baf480bfc2d1d056042145274f366395d5.tar.bz2 |
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
-rw-r--r-- | engine/lib/elgglib.php | 23 |
1 files 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); |