diff --git a/src/applications/paste/query/PhabricatorPasteQuery.php b/src/applications/paste/query/PhabricatorPasteQuery.php --- a/src/applications/paste/query/PhabricatorPasteQuery.php +++ b/src/applications/paste/query/PhabricatorPasteQuery.php @@ -185,7 +185,7 @@ $paste->getFilePHID(), $paste->getLanguage(), 'snippet', - 'v2', + 'v2.1', PhabricatorHash::digestForIndex($paste->getTitle()), )); } @@ -352,6 +352,9 @@ $snippet_type = PhabricatorPasteSnippet::FULL; $snippet = $paste->getRawContent(); + $lines = phutil_split_lines($snippet); + $line_count = count($lines); + if (strlen($snippet) > 1024) { $snippet_type = PhabricatorPasteSnippet::FIRST_BYTES; $snippet = id(new PhutilUTF8StringTruncator()) @@ -360,8 +363,6 @@ ->truncateString($snippet); } - $lines = phutil_split_lines($snippet); - $line_count = count($lines); if ($line_count > 5) { $snippet_type = PhabricatorPasteSnippet::FIRST_LINES; $snippet = implode('', array_slice($lines, 0, 5));