summaryrefslogtreecommitdiff
path: root/inc/html.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2013-08-22 01:12:47 -0700
committerAndreas Gohr <andi@splitbrain.org>2013-08-22 01:12:47 -0700
commit5a3aabcff0e246c29f47c1dd65301712cd553308 (patch)
tree2245231ac0dcbeea7084a751f89699e3307133f2 /inc/html.php
parentef0239a32ff44792b95819fe52398f3fc0dc4fae (diff)
parent7ef8e99fe605c5da36ab6b5d317b22fcd17f665b (diff)
downloadrpg-5a3aabcff0e246c29f47c1dd65301712cd553308.tar.gz
rpg-5a3aabcff0e246c29f47c1dd65301712cd553308.tar.bz2
Merge pull request #311 from mperry2/scopeindent
Fix CodeSniffer violations
Diffstat (limited to 'inc/html.php')
-rw-r--r--inc/html.php22
1 files changed, 11 insertions, 11 deletions
diff --git a/inc/html.php b/inc/html.php
index a2a726406..03e9dc751 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -1240,20 +1240,20 @@ function html_diff($text='',$intro=true,$type=null){
}
function html_insert_softbreaks($diffhtml) {
- // search the diff html string for both:
- // - html tags, so these can be ignored
- // - long strings of characters without breaking characters
- return preg_replace_callback('/<[^>]*>|[^<> ]{12,}/','html_softbreak_callback',$diffhtml);
+ // search the diff html string for both:
+ // - html tags, so these can be ignored
+ // - long strings of characters without breaking characters
+ return preg_replace_callback('/<[^>]*>|[^<> ]{12,}/','html_softbreak_callback',$diffhtml);
}
function html_softbreak_callback($match){
- // if match is an html tag, return it intact
- if ($match[0]{0} == '<') return $match[0];
+ // if match is an html tag, return it intact
+ if ($match[0]{0} == '<') return $match[0];
- // its a long string without a breaking character,
- // make certain characters into breaking characters by inserting a
- // breaking character (zero length space, U+200B / #8203) in front them.
- $regex = <<< REGEX
+ // its a long string without a breaking character,
+ // make certain characters into breaking characters by inserting a
+ // breaking character (zero length space, U+200B / #8203) in front them.
+ $regex = <<< REGEX
(?(?= # start a conditional expression with a positive look ahead ...
&\#?\\w{1,6};) # ... for html entities - we don't want to split them (ok to catch some invalid combinations)
&\#?\\w{1,6}; # yes pattern - a quicker match for the html entity, since we know we have one
@@ -1262,7 +1262,7 @@ function html_softbreak_callback($match){
)+ # end conditional expression
REGEX;
- return preg_replace('<'.$regex.'>xu','\0&#8203;',$match[0]);
+ return preg_replace('<'.$regex.'>xu','\0&#8203;',$match[0]);
}
/**