Skip to content

Commit

Permalink
#2711 Code improvement to make it work properly
Browse files Browse the repository at this point in the history
  • Loading branch information
MARQAS committed Dec 10, 2018
1 parent bd1da14 commit 1e65024
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions pagebuilder/inc/viewShowFrontData.php
Original file line number Diff line number Diff line change
Expand Up @@ -520,30 +520,34 @@ function autoCompileLess($css)
}
//Remove multiple Spaces
//padding:\s*?(\d*px)\s*(\d*px)\s*(\d*px)\s*(\d*px)\s*?;
/*$css = preg_replace_callback(
//"/(margin|padding):\s*?(\d*px)\s*(\d*px)\s*(\d*px)\s*(\d*px)\s*?\s*;/",
"/(margin|padding):\s*?(\d*(|px))\s*(\d*(|px))\s*(\d*(|px))\s*(\d*(|px))\s*?\s*;/",
$css = preg_replace_callback(
"/(margin|padding):\s*?(auto|\d*(|px))\s*(auto|\d*(|px))\s*(auto|\d*(|px))\s*(auto|\d*(|px))\s*?\s*;/",
function($m) {
if(count($m)==4){
if(count($m)!==0){
$m[2] = trim($m[2]);
$m[3] = trim($m[3]);
$m[4] = trim($m[4]);
$m[5] = trim($m[5]);
if(($m[2]==$m[4]) && $m[3] == $m[5]){
if( ($m[2]==$m[6]) && ($m[4] == $m[8]) ){
if ( $m[2] == $m[4] ) {
return $m[1].":".$m[2].";";
}
if(trim($parts[0])==trim($m[1])){
return $m[1].":".$m[2].";";
}else{
return $m[1].":".$m[2]." ".$m[3].";";
return $m[1].":".$m[2]." ".$m[4].";";
}
}else{
}
else{
return $m[0];
}
}else{
return $m[0];
}

},
$css);*/
$css);
// save CSS with groups of media query
return $css;
}
Expand Down

0 comments on commit 1e65024

Please sign in to comment.