aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-10-22 21:00:21 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-10-22 21:00:21 +0000
commit14e06c0c631bc03b4804019bf32b45dac97667c3 (patch)
treeaa823fe9793b85a3de4219209aa322b2fdb60a72 /engine
parentb36bf0e97e8dfbf2dcd07d4173392a3dcfbc2df0 (diff)
downloadelgg-14e06c0c631bc03b4804019bf32b45dac97667c3.tar.gz
elgg-14e06c0c631bc03b4804019bf32b45dac97667c3.tar.bz2
Refs #1330: Contributed autop() to Wordpress.
git-svn-id: http://code.elgg.org/elgg/trunk@3573 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/input.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/engine/lib/input.php b/engine/lib/input.php
index 289542547..a412f3644 100644
--- a/engine/lib/input.php
+++ b/engine/lib/input.php
@@ -116,6 +116,12 @@ function parse_urls($text) {
), $text);
}
+/**
+ *
+ * Adds P tags.
+ * Borrowed from Wordpress.
+ *
+ **/
function autop($pee, $br = 1) {
$pee = $pee . "\n"; // just to make things a little easier, pad the end
$pee = preg_replace('|<br />\s*<br />|', "\n\n", $pee);
@@ -359,4 +365,4 @@ function input_init() {
}
}
-register_elgg_event_handler('init','system','input_init'); \ No newline at end of file
+register_elgg_event_handler('init','system','input_init');