From a01a1281bbbe9063a7e8b4e43a556108a8d8e905 Mon Sep 17 00:00:00 2001 From: jloosli Date: Thu, 11 Oct 2012 17:18:40 -0600 Subject: [PATCH] fix roots_fix_duplicate_subfolder_urls isset check function checked if $matches[1] & $matches[2] were set, but next line operates on $matches[1][0] & $matches[2][0], so under certain circumstances, you get the following Notice: Undefined offset: 0. Now it checks for the [0] offsets from the start. --- lib/cleanup.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cleanup.php b/lib/cleanup.php index dfec989..ac5666c 100644 --- a/lib/cleanup.php +++ b/lib/cleanup.php @@ -160,7 +160,7 @@ function roots_fix_duplicate_subfolder_urls($input) { $output = roots_root_relative_url($input); preg_match_all('!([^/]+)/([^/]+)!', $output, $matches); - if (isset($matches[1]) && isset($matches[2])) { + if (isset($matches[1][0]) && isset($matches[2][0])) { if ($matches[1][0] === $matches[2][0]) { $output = substr($output, strlen($matches[1][0]) + 1); }