euromark 11 years ago
parent
commit
5013b95916

+ 1 - 1
Controller/Component/CommonComponent.php

@@ -569,7 +569,7 @@ class CommonComponent extends Component {
 	 * @return void
 	 */
 	public function monitorCookieProblems() {
-		$ip = $this->request->clientIp();
+		$ip = $this->Controller->request->clientIp();
 		$host = gethostbyaddr($ip);
 		$sessionId = session_id();
 		if (empty($sessionId)) {

+ 1 - 1
Controller/Component/MobileComponent.php

@@ -149,7 +149,7 @@ class MobileComponent extends Component {
 		*      (int) 0 => '/var/www/maps-cakephp2/app/View/'
 		* )
 		*/
-		$mobileViewFile = $viewDir[0] . $this->viewPath . DS . 'Mobile' . DS . $this->request->params['action'] . '.ctp';
+		$mobileViewFile = $viewDir[0] . $this->viewPath . DS . 'Mobile' . DS . $this->params['action'] . '.ctp';
 
 		//Debugger::log($this->viewPath);
 		// use this to log the output to

+ 4 - 6
Model/Behavior/JsonableBehavior.php

@@ -177,8 +177,7 @@ class JsonableBehavior extends ModelBehavior {
 			// $depth param added in php 5.5
 			if (version_compare(PHP_VERSION, '5.5.0', '>=')) {
 				$val = json_encode($val, $this->settings[$Model->alias]['encodeParams']['options'], $this->settings[$Model->alias]['encodeParams']['depth']);
-			} 
-			else {
+			} else {
 				$val = json_encode($val, $this->settings[$Model->alias]['encodeParams']['options']);
 			}
 		}
@@ -195,10 +194,9 @@ class JsonableBehavior extends ModelBehavior {
 	public function _decode(Model $Model, $val) {
 		// $options param added in php 5.4
 		if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
-		    $decoded = json_decode($val, $this->settings[$Model->alias]['decodeParams']['assoc'], $this->settings[$Model->alias]['decodeParams']['depth'], $this->settings[$Model->alias]['decodeParams']['options']); 
-		} 
-		else {
-		    $decoded = json_decode($val, $this->settings[$Model->alias]['decodeParams']['assoc'], $this->settings[$Model->alias]['decodeParams']['depth']); 
+			$decoded = json_decode($val, $this->settings[$Model->alias]['decodeParams']['assoc'], $this->settings[$Model->alias]['decodeParams']['depth'], $this->settings[$Model->alias]['decodeParams']['options']); 
+		} else {
+			$decoded = json_decode($val, $this->settings[$Model->alias]['decodeParams']['assoc'], $this->settings[$Model->alias]['decodeParams']['depth']); 
 		}
 
 		if ($decoded === false) {

+ 0 - 1
Test/Case/Lib/GeocodeLibTest.php

@@ -60,7 +60,6 @@ class GeocodeLibTest extends MyCakeTestCase {
 		}',
 	);
 
-
 	public function setUp() {
 		parent::setUp();
 

+ 0 - 1
Test/Case/Lib/InlineCssLibTest.php

@@ -230,5 +230,4 @@ bla';
 		$this->assertTextContains('香港酒店', $result);
 	}
 
-
 }

+ 0 - 2
Test/Case/Model/Behavior/JsonableBehaviorTest.php

@@ -174,7 +174,6 @@ class JsonableBehaviorTest extends MyCakeTestCase {
 		$expected = array();
 		$this->assertEquals($expected, $res['JsonableComment']['details']);
 
-
 		// Test encode depth = 2
 		$this->Comment->Behaviors->unload('Jsonable');
 		$this->Comment->Behaviors->load('Tools.Jsonable', array('fields' => array('details'), 'encodeParams' => array('depth' => 2)));
@@ -212,7 +211,6 @@ class JsonableBehaviorTest extends MyCakeTestCase {
 		$expected = array('x' => $obj);
 		$this->assertEquals($expected, $res['JsonableComment']['details']);
 
-
 		// Test decode with assoc = true
 		$this->Comment->Behaviors->unload('Jsonable');
 		$this->Comment->Behaviors->load('Tools.Jsonable', array('fields' => array('details'), 'decodeParams' => array('assoc' => true)));

+ 0 - 1
View/Helper/CommonHelper.php

@@ -163,7 +163,6 @@ class CommonHelper extends AppHelper {
 		return $text;
 	}
 
-
 	/**
 	 * Alternates between two or more strings.
 	 *

+ 1 - 1
View/RssView.php

@@ -245,7 +245,7 @@ class RssView extends View {
 	protected function _prepareOutput($item) {
 		foreach ($item as $key => $val) {
 			$prefix = null;
-			// The cast prevents a PHP bug for switch() and false positives with integers
+			// The cast prevents a PHP bug for switch case and false positives with integers
 			$bareKey = (string)$key;
 
 			// Detect namespaces