aboutsummaryrefslogtreecommitdiffstats
path: root/library/Smarty/libs/plugins/modifier.regex_replace.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2015-12-06 21:09:58 +0100
committerMario Vavti <mario@mariovavti.com>2015-12-06 21:09:58 +0100
commit26c465ad0c1d5b6801507ed190430f44ac92c672 (patch)
tree9e80c34da1235e6dd55942c23bf9511fac31344d /library/Smarty/libs/plugins/modifier.regex_replace.php
parentf2d70831838b0738e6895296f3e8ce02f86fec2f (diff)
downloadvolse-hubzilla-26c465ad0c1d5b6801507ed190430f44ac92c672.tar.gz
volse-hubzilla-26c465ad0c1d5b6801507ed190430f44ac92c672.tar.bz2
volse-hubzilla-26c465ad0c1d5b6801507ed190430f44ac92c672.zip
update smarty to 3.1.28-dev which fixes a bug where changes in a template are only visible on the second pageload which is annoying for developing
Diffstat (limited to 'library/Smarty/libs/plugins/modifier.regex_replace.php')
-rw-r--r--library/Smarty/libs/plugins/modifier.regex_replace.php5
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);
}
/**