aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/output.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-26 15:51:35 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-26 15:51:35 +0000
commitc13f548c43aac69f121363ffafc77a6571a71df1 (patch)
tree78f24432c882baa759d096c12c0165e86e31217e /engine/lib/output.php
parent34c502d94a0a729c99ad538ecf3e6e4ceeb8353e (diff)
downloadelgg-c13f548c43aac69f121363ffafc77a6571a71df1.tar.gz
elgg-c13f548c43aac69f121363ffafc77a6571a71df1.tar.bz2
some light standardization of the core libraries
git-svn-id: http://code.elgg.org/elgg/trunk@8843 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/output.php')
-rw-r--r--engine/lib/output.php25
1 files changed, 11 insertions, 14 deletions
diff --git a/engine/lib/output.php b/engine/lib/output.php
index 7a38e5b8c..8c2a3d50d 100644
--- a/engine/lib/output.php
+++ b/engine/lib/output.php
@@ -59,7 +59,7 @@ function autop($pee, $br = 1) {
$pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee);
$pee = preg_replace('!(</' . $allblocks . '>)!', "$1\n\n", $pee);
$pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines
- if ( strpos($pee, '<object') !== false ) {
+ if (strpos($pee, '<object') !== false) {
$pee = preg_replace('|\s*<param([^>]*)>\s*|', "<param$1>", $pee); // no pee inside object/embed
$pee = preg_replace('|\s*</embed>\s*|', '</embed>', $pee);
}
@@ -238,25 +238,22 @@ function elgg_normalize_url($url) {
// '#target', '?query=string'
if (preg_match("#^(\#|\?|(https?:)?//)#i", $url)) {
return $url;
- }
- // 'javascript:'
- elseif (stripos($url, 'javascript:') === 0) {
+ } elseif (stripos($url, 'javascript:') === 0) {
+ // 'javascript:'
return $url;
- }
- // 'install.php', 'install.php?step=step'
- elseif (preg_match("#^[^/]*\.php(\?.*)?$#i", $url)) {
- return elgg_get_site_url().$url;
- }
+ } elseif (preg_match("#^[^/]*\.php(\?.*)?$#i", $url)) {
+ // 'install.php', 'install.php?step=step'
+ return elgg_get_site_url() . $url;
- // 'example.com', 'example.com/subpage'
- elseif (preg_match("#^[^/]*\.#i", $url)) {
+ } elseif (preg_match("#^[^/]*\.#i", $url)) {
+ // 'example.com', 'example.com/subpage'
return "http://$url";
- }
- // 'page/handler', 'mod/plugin/file.php'
- else {
+ } else {
+ // 'page/handler', 'mod/plugin/file.php'
+
// trim off any leading / because the site URL is stored
// with a trailing /
return elgg_get_site_url() . ltrim($url, '/');