aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/elgglib.php23
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);