X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=vendor%2Fsmarty%2Fsmarty%2Flibs%2Fplugins%2Fmodifiercompiler.count_paragraphs.php;fp=vendor%2Fsmarty%2Fsmarty%2Flibs%2Fplugins%2Fmodifiercompiler.count_paragraphs.php;h=f7f447763ce42830536f3ea0d3974a171e32735e;hb=7f447368035b558931da5c1785560c4105ccd1e5;hp=0000000000000000000000000000000000000000;hpb=f97752383ab84cf6f95a56363e005a43d869e828;p=friendica.git diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_paragraphs.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_paragraphs.php new file mode 100644 index 0000000000..f7f447763c --- /dev/null +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_paragraphs.php @@ -0,0 +1,27 @@ + + * Name: count_paragraphs
+ * Purpose: count the number of paragraphs in a text + * + * @link http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php + * count_paragraphs (Smarty online manual) + * @author Uwe Tews + * + * @param array $params parameters + * + * @return string with compiled code + */ +function smarty_modifiercompiler_count_paragraphs($params) +{ + // count \r or \n characters + return '(preg_match_all(\'#[\r\n]+#\', ' . $params[ 0 ] . ', $tmp)+1)'; +}