Skip to content

Commit

Permalink
Fix : supports 'http://' in css inliner properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Boyer committed Jun 1, 2012
1 parent bff5cd1 commit 079b326
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions classes/owcssinline.php
Expand Up @@ -57,7 +57,7 @@ public function css_inline( $content, $dir_css ) {
$args = trim($args);

if ( $selector!='' && $args!='' && $selector!='\0' && $args!='\0' ) {

// Get matched elements from DOM
$matches = $html->find($selector);

Expand All @@ -78,8 +78,10 @@ public function css_inline( $content, $dir_css ) {
// Store each old css rule from html
foreach( $old_styles_array as $old_rule ) {
$old = explode(':', $old_rule);
if( count($old) > 1) {
if( count($old) > 1 ) {
$old_rules_array[trim($old[0])] = trim($old[1]);
for( $i=2; $i<count($old); $i++)
$old_rules_array[trim($old[0])] .= ':'.trim($old[$i]);
}
}

Expand All @@ -88,6 +90,8 @@ public function css_inline( $content, $dir_css ) {
$new = explode(':', $new_rule);
if( count($new) > 1) {
$new_rules_array[trim($new[0])] = trim($new[1]);
for( $i=2; $i<count($new); $i++)
$new_rules_array[trim($new[0])] .= ':'.trim($new[$i]);
}
}

Expand Down

0 comments on commit 079b326

Please sign in to comment.