com karma: check for non-empty shortMsg: hooks/post-receive.bugsweb

From: Date: Tue, 14 Jan 2014 12:11:45 +0000
Subject: com karma: check for non-empty shortMsg: hooks/post-receive.bugsweb
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-75621@lists.php.net to get a copy of this message
Commit: 3f2060b2b660e7a002c82ede71ca2785bdb2280b Author: Peter Cowburn <petercowburn@gmail.com> Tue, 14 Jan 2014 12:11:45 +0000 Parents: eb861394ff5c8221882a09bccb6b5c918fb1b71c Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=3f2060b2b660e7a002c82ede71ca2785bdb2280b Log: check for non-empty shortMsg The $shortMsg value can be an empty string when the bug number is the last thing in the commit log line: e.g. "[user@php.net] 0df3233344 Fixed bug #1234" This variable is not currently used anywhere, so we could probably remove it entirely. But for the moment, let's just fix the Notices being printed. Bugs: https://bugs.php.net/1234 Changed paths: M hooks/post-receive.bugsweb Diff: diff --git a/hooks/post-receive.bugsweb b/hooks/post-receive.bugsweb index fc95c13..bba2e19 100755 --- a/hooks/post-receive.bugsweb +++ b/hooks/post-receive.bugsweb @@ -49,11 +49,13 @@ foreach ($rpath as $commit) { $commitMsg = trim($matches[3]); $bugNumber = $matches[6]; $shortMsg = trim($matches[7]); - if ($shortMsg[0] == '(') { - $shortMsg = substr($shortMsg, 1); - } - if ($shortMsg[strlen($shortMsg)-1] == ')') { - $shortMsg = substr($shortMsg, 0, -1); + if (strlen($shortMsg) > 0) { + if ($shortMsg[0] == '(') { + $shortMsg = substr($shortMsg, 1); + } + if ($shortMsg[strlen($shortMsg)-1] == ')') { + $shortMsg = substr($shortMsg, 0, -1); + } } $output = sprintf(

« previous php.cvs (#75621) next »