Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F868525
large_lines.diff
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
epriestley
Oct 8 2015, 5:42 PM
2015-10-08 17:42:12 (UTC+0)
Size
611 B
Referenced Files
None
Subscribers
None
large_lines.diff
View Options
diff --git a/src/utils/utils.php b/src/utils/utils.php
index 5e5f305..d7f8482 100644
--- a/src/utils/utils.php
+++ b/src/utils/utils.php
@@ -770,6 +770,16 @@ function phutil_split_lines($corpus, $retain_endings = true) {
return array('');
}
+ $lines = substr_count($corpus, "\n");
+ $limit = 1024;
+ if ($lines > $limit) {
+ throw new Exception(
+ pht(
+ 'Huge input! Found %s lines, hoped for %s.',
+ new PhutilNumber($lines),
+ new Phutilnumber($limit)));
+ }
+
// Split on "\r\n" or "\n".
if ($retain_endings) {
$lines = preg_split('/(?<=\n)/', $corpus);
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/4j/as/lpf2n3jgw23lqaav
Default Alt Text
large_lines.diff (611 B)
Attached To
Mode
P1863 large_lines.diff
Attached
Detach File
Event Timeline
Log In to Comment