$ui = parse_url($base);
+ if($ui['host'] == 'localhost'){
+ return $ui['scheme'] .'://'.$ui['host']. $ui['path'] . '/'. $url;
+ }
+
if (substr($url,0,2) == '//') {
return $ui['scheme'] .':' . $url;
}
if (substr($url,0,1) == '/') {
return $ui['scheme'] .'://'.$ui['host']. $url;
}
- print_r($url);exit;
+
if (substr($ui['path'], -1) == '/') {
return $ui['scheme'] .'://'.$ui['host']. $ui['path'] . $url;
}
function convertStyle($url, $file, $is_url = true)
{
+ $inLineCss = true;
+
if($is_url && !empty($url))
{
$host = parse_url($url);
$data = file_get_contents($file);
}
+ if(preg_match('/^\s*<!--\s*NOT CONVERT STYLE\s*-->\s*/', $data)){
+ $inLineCss = false;
+ }
libxml_use_internal_errors (true);
$doc = new DOMDocument('1.0', 'UTF-8');
$data = $doc->saveHTML();
+ if(!$inLineCss){
+ return $data;
+ }
+
$htmldoc = new HTML_CSS_InlineStyle($data);
if(count($this->styleSheets) > 0){
foreach ($this->styleSheets as $styleSheet){