From f177702ca3cf25ba859e66a1d8c57bd74f290b2c Mon Sep 17 00:00:00 2001 From: Edward Date: Wed, 19 Feb 2014 18:18:38 +0800 Subject: [PATCH] ConvertStyle.php --- ConvertStyle.php | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/ConvertStyle.php b/ConvertStyle.php index 491cdf6a..be0def9f 100644 --- a/ConvertStyle.php +++ b/ConvertStyle.php @@ -61,25 +61,25 @@ class Pman_Core_ConvertStyle extends Pman var $styleSheets = array(); - function convertStyle($url, $file, $is_url = false) + function convertStyle($url, $file, $is_url = true) { -// if(!empty($url)) -// { -// $host = parse_url($url); -// require_once 'System.php'; -// $wget = System::which('wget'); -// if (!$wget) { -// $this->jerr("no wget"); -// } -// $cmd = $wget . ' -q -O - ' . escapeshellarg($url); -// -// //echo $cmd; exit; -// $data = `$cmd`; -// -// if (!trim(strlen($data))) { -// $this->jerr("url returned an empty string"); -// } -// } + if($is_url && !empty($url)) + { + $host = parse_url($url); + require_once 'System.php'; + $wget = System::which('wget'); + if (!$wget) { + $this->jerr("no wget"); + } + $cmd = $wget . ' -q -O - ' . escapeshellarg($url); + + //echo $cmd; exit; + $data = `$cmd`; + + if (!trim(strlen($data))) { + $this->jerr("url returned an empty string"); + } + } if(!$is_url){ $data = file_get_contents($file); -- 2.39.2