aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/output.php21
1 files changed, 19 insertions, 2 deletions
diff --git a/engine/lib/output.php b/engine/lib/output.php
index 6e861e4ac..461f34057 100644
--- a/engine/lib/output.php
+++ b/engine/lib/output.php
@@ -1,7 +1,7 @@
<?php
/**
* Output functions
- * Processing text for output, formatting HTML,
+ * Processing text for output, formatting HTML,
*
* @package Elgg
* @subpackage Core
@@ -100,7 +100,7 @@ function autop($pee, $br = 1) {
function elgg_make_excerpt($text, $num_chars = 250) {
$text = trim(strip_tags($text));
$string_length = elgg_strlen($text);
-
+
if ($string_length <= $num_chars) {
return $text;
}
@@ -152,3 +152,20 @@ function friendly_title($title) {
function friendly_time($time) {
return elgg_view('output/friendlytime', array('time' => $time));
}
+
+/**
+ * Strip tags and offer plugins the chance.
+ * Plugins register for output:strip_tags plugin hook.
+ * Original string included in $params['original_string']
+ *
+ * @param string $string Formatted string
+ * @return string String run through strip_tags() and any plugin hooks.
+ */
+function elgg_strip_tags($string) {
+ $params['original_string'] = $string;
+
+ $string = strip_tags($string);
+ $string = trigger_plugin_hook('output', 'strip_tags', $params, $string);
+
+ return $string;
+} \ No newline at end of file