diff --git a/application/models/helper/dbh.php b/application/models/helper/dbh.php index ac73e3c5..f9af1ecc 100644 --- a/application/models/helper/dbh.php +++ b/application/models/helper/dbh.php @@ -80,6 +80,10 @@ class dbh { $v = preg_replace("/\'/","''",$v); } + if(preg_match("/\"/",$v)) + { + $v = preg_replace("/\"/","''",$v); + } $ups[] = '"'.$k.'"=\''.$v."'"; } } diff --git a/application/models/helper/view.php b/application/models/helper/view.php index 300f3a5d..c4fc32d6 100644 --- a/application/models/helper/view.php +++ b/application/models/helper/view.php @@ -1,5 +1,5 @@ db = $db; } - static function addPaginator($data,$ctl,Zend_Controller_Request_Abstract $request = NULL,$limit = 10) + static function addPaginator($data,$ctl,\Zend_Controller_Request_Abstract $request = NULL,$limit = 10) { if(empty($request)) { @@ -21,11 +21,11 @@ class view extends Zend_Controller_Plugin_Abstract $view = $ctl; } - $paginator = Zend_Paginator::factory($data); + $paginator = \Zend_Paginator::factory($data); $paginator->setCurrentPageNumber($page); $paginator->setItemCountPerPage($limit); $paginator->setView($view); - Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); + \Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); $view->paginator = $paginator; } @@ -70,7 +70,7 @@ class view extends Zend_Controller_Plugin_Abstract } static function User($param){ - $auth = Zend_Auth::getInstance(); + $auth = \Zend_Auth::getInstance(); if($auth->hasIdentity()) { $user = $auth->getIdentity(); @@ -90,7 +90,7 @@ class view extends Zend_Controller_Plugin_Abstract } } - static function Post(Zend_Controller_Action $ctl,$msg,$url=""){ + static function Post(\Zend_Controller_Action $ctl,$msg,$url=""){ if(empty($msg)) { @@ -101,10 +101,20 @@ class view extends Zend_Controller_Plugin_Abstract $msg = array('content'=>$msg,'url'=>$url); } - $helper = new Zend_Controller_Action_HelperBroker($ctl); + $helper = new \Zend_Controller_Action_HelperBroker($ctl); $helper->layout->setLayout('layout'); $helper->viewRenderer->setNoRender(); echo $ctl->view->partial('post-message.phtml', $msg); return true; } + + static function getHostLink() + { + $protocol = "http"; + if(strpos(strtolower($_SERVER['SERVER_PROTOCOL']),"https")) + { + $protocol = "https"; + } + return $protocol."://".$_SERVER['SERVER_NAME']; + } } \ No newline at end of file