Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bc70895

Browse files
committed
TexyLongWordsModule: added SAFE_LIMIT
1 parent 37f0d96 commit bc70895

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

texy/modules/TexyLongWordsModule.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ final class TexyLongWordsModule extends TexyModule
2121
{
2222
public $wordLimit = 20;
2323

24-
2524
const
2625
DONT = 0, // don't hyphenate
2726
HERE = 1, // hyphenate here
2827
AFTER = 2; // hyphenate after
2928

29+
const SAFE_LIMIT = 1000;
3030

3131
private $consonants = array(
3232
'b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','z',
@@ -93,6 +93,8 @@ private function pattern($matches)
9393
list($mWord) = $matches;
9494
// [0] => lllloooonnnnggggwwwoorrdddd
9595

96+
if (iconv_strlen($mWord) > self::SAFE_LIMIT) return $mWord;
97+
9698
$chars = array();
9799
preg_match_all(
98100
'#['.TEXY_MARK.']+|.#u',

0 commit comments

Comments
 (0)