Permalink
Browse files

Fix a number of errors with PHP 5.4

  • Loading branch information...
markstory committed Dec 28, 2011
1 parent 482e487 commit 9950af8bb50d47e1ebeaf59230ab52dbd33456c7
View
@@ -17,4 +17,5 @@
* @since CakePHP(tm) v 1.1.11.4062
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-return $config['Cake.version'] = '1.3.13';
+$config['Cake.version'] = '1.3.13';
+return $config;
View
@@ -629,7 +629,10 @@ function _output($data = array()) {
$data += $defaults;
$files = $this->trace(array('start' => 2, 'format' => 'points'));
- $code = $this->excerpt($files[0]['file'], $files[0]['line'] - 1, 1);
+ $code = '';
+ if (isset($files[0]['file'])) {
+ $code = $this->excerpt($files[0]['file'], $files[0]['line'] - 1, 1);
+ }
$trace = $this->trace(array('start' => 2, 'depth' => '20'));
$insertOpts = array('before' => '{:', 'after' => '}');
$context = array();
@@ -557,6 +557,9 @@ function _arrayDiffAssoc($array1, $array2) {
$difference[$key] = $value;
continue;
}
+ if (is_array($value) && is_array($correspondingValue)) {
+ continue;
+ }
$compare = strval($value);
$correspondingValue = strval($correspondingValue);
if ($compare === $correspondingValue) {
View
@@ -1047,7 +1047,7 @@ function mimeEncode($string, $charset = null, $newline = "\r\n") {
$parts = array();
$maxchars = floor(($length * 3) / 4);
while (strlen($string) > $maxchars) {
- $i = $maxchars;
+ $i = (int)$maxchars;
$test = ord($string[$i]);
while ($test >= 128 && $test <= 191) {
$i--;
View
@@ -948,7 +948,14 @@ function _handleNoRoute($url) {
if (!empty($named)) {
foreach ($named as $name => $value) {
- $output .= '/' . $name . $this->named['separator'] . $value;
+ if (is_array($value)) {
+ $flattend = Set::flatten($value, '][');
+ foreach ($flattend as $namedKey => $namedValue) {
+ $output .= '/' . $name . "[$namedKey]" . $this->named['separator'] . $namedValue;
+ }
+ } else {
+ $output .= '/' . $name . $this->named['separator'] . $value;
+ }
}
}
return $output;
View
@@ -704,6 +704,9 @@ function insert($list, $path, $data = null) {
}
$_list =& $_list[$key];
}
+ if (!is_array($_list)) {
+ return array();
+ }
}
return $list;
}
@@ -74,6 +74,7 @@ function startTest() {
$this->Dispatcher =& new TestFixtureTaskMockShellDispatcher();
$this->Task =& new MockFixtureTask();
$this->Task->Model =& new MockFixtureModelTask();
+ $this->Task->DbConfig =& new MockFixtureModelTask();
$this->Task->Dispatch =& $this->Dispatcher;
$this->Task->Template =& new TemplateTask($this->Task->Dispatch);
$this->Task->Dispatch->shellPaths = App::path('shells');
@@ -260,6 +260,7 @@ function startTest() {
$this->Task->Template =& new TemplateTask($this->Dispatcher);
$this->Task->Controller =& new ViewTaskMockControllerTask();
$this->Task->Project =& new ViewTaskMockProjectTask();
+ $this->Task->DbConfig =& new ViewTaskMockProjectTask();
$this->Task->path = TMP;
$this->Task->Template->params['theme'] = 'default';
@@ -2674,7 +2674,7 @@ function testSaveAllHabtm() {
$this->assertEqual(count($result['Tag']), 2);
$this->assertEqual($result['Tag'][0]['tag'], 'tag1');
$this->assertEqual(count($result['Comment']), 1);
- $this->assertEqual(count($result['Comment'][0]['comment']['Article comment']), 1);
+ $this->assertEqual(count($result['Comment'][0]['comment']), 1);
}
/**

0 comments on commit 9950af8

Please sign in to comment.