Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13990132
D17438.id41935.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D17438.id41935.diff
View Options
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));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Oct 23, 1:30 AM (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6743292
Default Alt Text
D17438.id41935.diff (1 KB)
Attached To
Mode
D17438: Get line count before truncating Paste snippets
Attached
Detach File
Event Timeline
Log In to Comment