From a86eeac0ab678ea55307e1386c5f955f77d8ff73 Mon Sep 17 00:00:00 2001 From: arno Date: Mon, 27 Sep 2010 10:46:03 +0200 Subject: [PATCH] do not fail when client uses a proxy --- application/controllers/IdxController.php | 3 ++- application/controllers/PathController.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/application/controllers/IdxController.php b/application/controllers/IdxController.php index ee1efb0..3996fa0 100644 --- a/application/controllers/IdxController.php +++ b/application/controllers/IdxController.php @@ -66,7 +66,8 @@ class IdxController extends Zend_Controller_Action $geomform->geom_title->setValue($path->title); } else { $geomform->setAction('path'); - $extent = new phptojs\JsObject('gMaxExtent', $this->_helper->syjGeoip($this->getRequest()->getClientIp(true))); + $clientip = trim(end(split(',', $this->getRequest()->getClientIp(true)))); + $extent = new phptojs\JsObject('gMaxExtent', $this->_helper->syjGeoip($clientip)); $this->view->headScript()->prependScript((string) $extent); $title = "Show your journey"; } diff --git a/application/controllers/PathController.php b/application/controllers/PathController.php index bb969e8..48a22be 100644 --- a/application/controllers/PathController.php +++ b/application/controllers/PathController.php @@ -13,7 +13,7 @@ class PathController extends Zend_Controller_Action throw new Syj_Exception_Request(); } $path->creator = $user; - $path->creatorIp = $this->getRequest()->getClientIp(true); + $path->creatorIp = trim(end(split(',', $this->getRequest()->getClientIp(true)))); $this->save($path, $formData); $data = array('redirect' => "idx/" . (string)$path->id); -- 2.39.2