From b3a70ac2069f2de0fa79eb5849d7841cdb643a4e Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 29 Feb 2012 08:39:25 -0800 Subject: [PATCH] Use string operations, not idx(), for string indexing. Summary: Missed this in review (D1715), idx() does not operate on strings (maybe it does in HPHP/i?). Test Plan: Faked an editable lint warning, ran "arc lint". Reviewers: Koolvin, andrewjcg, btrahan Reviewed By: Koolvin CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D1728 --- src/lint/renderer/ArcanistLintRenderer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lint/renderer/ArcanistLintRenderer.php b/src/lint/renderer/ArcanistLintRenderer.php index f8a458ca..fa966fe1 100644 --- a/src/lint/renderer/ArcanistLintRenderer.php +++ b/src/lint/renderer/ArcanistLintRenderer.php @@ -160,7 +160,7 @@ final class ArcanistLintRenderer { if ($message->isPatchable()) { // Strip trailing newlines, since "explode" will create an extra patch // line for these. - if (idx($patch, strlen($patch) - 1, null) === "\n") { + if (strlen($patch) && ($patch[strlen($patch) - 1] === "\n")) { $patch = substr($patch, 0, -1); } $patch_lines = explode("\n", $patch);