From df287e4549df0cfa248a43fe9514189a9cc7cc22 Mon Sep 17 00:00:00 2001 From: wlx Date: Mon, 28 Nov 2011 14:43:37 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9cnki=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E7=9A=84=E6=AD=A3=E5=88=99=EF=BC=8C=E8=A7=A3=E5=86=B3=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E7=AC=AC=E4=B8=80=E4=B8=AA=E7=BB=93=E6=9E=9C=E7=9A=84?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/default/controllers/ServiceController.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/application/default/controllers/ServiceController.php b/application/default/controllers/ServiceController.php index 46d18637..2800dfbc 100644 --- a/application/default/controllers/ServiceController.php +++ b/application/default/controllers/ServiceController.php @@ -944,8 +944,9 @@ class ServiceController extends Zend_Controller_Action curl_close($ch); $rev = array(); - $max = 5; - if(preg_match_all("#(.+?)#i",$body,$matchs,PREG_PATTERN_ORDER)) + $max = 5; + $error=''; + if(preg_match_all("#(.+?)<\/a>#im",$body,$matchs,PREG_PATTERN_ORDER)) { foreach ($matchs[2] as $k=>$v){ if($k < $max) $rev[$k]['title']=$v; @@ -957,7 +958,7 @@ class ServiceController extends Zend_Controller_Action $error = "无搜索结果"; } - if(preg_match_all("#(.+?)#i",$body,$matchs,PREG_PATTERN_ORDER)) + if(preg_match_all("#(.+?)<\/span>#im",$body,$matchs,PREG_PATTERN_ORDER)) { foreach ($matchs[1] as $k=>$v){ if($k < $max) $rev[$k]['content']=$v;