]> dev.renevier.net Git - syj.git/commitdiff
do not fail when client uses a proxy
authorarno <arno@renevier.net>
Mon, 27 Sep 2010 08:46:03 +0000 (10:46 +0200)
committerarno <arno@renevier.net>
Mon, 27 Sep 2010 08:46:03 +0000 (10:46 +0200)
application/controllers/IdxController.php
application/controllers/PathController.php

index ee1efb06d291453c9dccc14647efc81eb5efbba3..3996fa04e8e6c5c4adfc7de65293b0627c382cbf 100644 (file)
@@ -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";
         }
index bb969e82c8ed6b15888a6cf9de01adc0510c7a4e..48a22befd43930ef1d0f6a8036e28524c1ea347d 100644 (file)
@@ -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);