From 7bbb2f9403e9f78bf0fda5fe1706ec8b261c2cc0 Mon Sep 17 00:00:00 2001 From: Lee Bousfield Date: Thu, 4 Feb 2016 09:48:23 -0700 Subject: [PATCH] Ignore blank lines (previously caused a warning) Bug: T125800 Change-Id: I54c320079ca787f977f02ed26092da86dba22dcd --- TitleBlacklist.list.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/TitleBlacklist.list.php b/TitleBlacklist.list.php index 1c1a8950..dd1f59bc 100644 --- a/TitleBlacklist.list.php +++ b/TitleBlacklist.list.php @@ -464,6 +464,10 @@ class TitleBlacklistEntry { // Strip comments $line = preg_replace( "/^\\s*([^#]*)\\s*((.*)?)$/", "\\1", $line ); $line = trim( $line ); + // A blank string causes problems later on + if ( $line === '' ) { + return null; + } // Parse the rest of message $pockets = []; if ( !preg_match( '/^(.*?)(\s*<([^<>]*)>)?$/', $line, $pockets ) ) {