diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-12-06 14:22:55 -0800 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-12-06 14:22:55 -0800 |
commit | a88ec1b1af954a447a666d3ff66b1d1df0a645db (patch) | |
tree | 7ccfe6a03923ad118910202e21a605e13127192c /library/Smarty/libs/plugins/modifier.regex_replace.php | |
parent | 553b3a5c6c2ba6b93ad1193ec044ee92cf7690aa (diff) | |
parent | a6cb25020bb5200cc3c00ecc941ddb751644fbcc (diff) | |
download | volse-hubzilla-a88ec1b1af954a447a666d3ff66b1d1df0a645db.tar.gz volse-hubzilla-a88ec1b1af954a447a666d3ff66b1d1df0a645db.tar.bz2 volse-hubzilla-a88ec1b1af954a447a666d3ff66b1d1df0a645db.zip |
Merge https://github.com/redmatrix/hubzilla into pending_merge
Diffstat (limited to 'library/Smarty/libs/plugins/modifier.regex_replace.php')
-rw-r--r-- | library/Smarty/libs/plugins/modifier.regex_replace.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/library/Smarty/libs/plugins/modifier.regex_replace.php b/library/Smarty/libs/plugins/modifier.regex_replace.php index abb1ff548..ffea16755 100644 --- a/library/Smarty/libs/plugins/modifier.regex_replace.php +++ b/library/Smarty/libs/plugins/modifier.regex_replace.php @@ -19,10 +19,11 @@ * @param string $string input string * @param string|array $search regular expression(s) to search for * @param string|array $replace string(s) that should be replaced + * @param int $limit the maximum number of replacements * * @return string */ -function smarty_modifier_regex_replace($string, $search, $replace) +function smarty_modifier_regex_replace($string, $search, $replace, $limit = -1) { if (is_array($search)) { foreach ($search as $idx => $s) { @@ -32,7 +33,7 @@ function smarty_modifier_regex_replace($string, $search, $replace) $search = _smarty_regex_replace_check($search); } - return preg_replace($search, $replace, $string); + return preg_replace($search, $replace, $string, $limit); } /** |