Catrope has uploaded a new change for review.
https://gerrit.wikimedia.org/r/285537
Change subject: Fix deepest common root when first path is longer and later is
a prefix
......................................................................
Fix deepest common root when first path is longer and later is a prefix
Bug: T133731
Change-Id: I08baf5c94f26a50b4f17e2ccc0eab89053742817
(cherry picked from commit d3b55feffb0c78150a7961e44fa0020bb15dd4a6)
---
M includes/Notifications/Controller.php
M tests/phpunit/Notifications/NotificationControllerTest.php
2 files changed, 23 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow
refs/changes/37/285537/1
diff --git a/includes/Notifications/Controller.php
b/includes/Notifications/Controller.php
index 25fc921..6eb166a 100644
--- a/includes/Notifications/Controller.php
+++ b/includes/Notifications/Controller.php
@@ -750,7 +750,7 @@
$possibleDeepestRoot = $firstPath[$i];
foreach ( $rootPaths as $path ) {
- if ( !$path[$i]->equals( $possibleDeepestRoot )
) {
+ if ( !isset( $path[$i] ) || !$path[$i]->equals(
$possibleDeepestRoot ) ) {
// Mismatch. Return the last match we
found
return $deepestRoot;
}
diff --git a/tests/phpunit/Notifications/NotificationControllerTest.php
b/tests/phpunit/Notifications/NotificationControllerTest.php
index 410ccea..a15a976 100644
--- a/tests/phpunit/Notifications/NotificationControllerTest.php
+++ b/tests/phpunit/Notifications/NotificationControllerTest.php
@@ -44,7 +44,7 @@
),
array(
UUID::create( 't2et6t35psmz1ac2' ),
- 'Not same length',
+ 'First shorter',
array(
't2f2mdjbw1dcfkia' => array(
UUID::create(
't2et4aiiijstihea' ),
@@ -61,6 +61,27 @@
),
),
),
+ array(
+ UUID::create( 't2f2re4e901we1zm' ),
+ 'First longer, second truncated version of
first',
+ array(
+ 't2feoifdgpa2rt02' => array(
+ UUID::create(
't2et4aiiijstihea' ),
+ UUID::create(
't2et4aiwjnpnk5ua' ),
+ UUID::create(
't2et6t35psmz1ac2' ),
+ UUID::create(
't2f2mdjbw1dcfkia' ),
+ UUID::create(
't2f2re4e901we1zm' ),
+ UUID::create(
't2feoifdgpa2rt02' ),
+ ),
+ 't2f2re4e901we1zm' => array(
+ UUID::create(
't2et4aiiijstihea' ),
+ UUID::create(
't2et4aiwjnpnk5ua' ),
+ UUID::create(
't2et6t35psmz1ac2' ),
+ UUID::create(
't2f2mdjbw1dcfkia' ),
+ UUID::create(
't2f2re4e901we1zm' ),
+ ),
+ ),
+ ),
);
}
--
To view, visit https://gerrit.wikimedia.org/r/285537
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I08baf5c94f26a50b4f17e2ccc0eab89053742817
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: wmf/1.27.0-wmf.22
Gerrit-Owner: Catrope <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits