Page MenuHomePhabricator

wrong diff3 location calculation
Closed, ResolvedPublic

Description

Author: keymone

Description:
in /wiki/config/index.php on line 421 wrong operation applied to arrays
on my PHP 5.1.4
$array1 + $array2 cause replacing $array1[0] = $array2[0] and so on
using array_marge($array1,$array2) solves the problem


Version: 1.7.x
Severity: normal
OS: Windows XP
Platform: PC

Details

Reference
bz7294

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:27 PM
bzimport set Reference to bz7294.
bzimport added a subscriber: Unknown Object (MLST).

Applying said patch causes running index.php to halt after the following
initialisation sequence of the install page. The patch given appears to break
MediaWiki. WONTFIX.

  • PHP 5.1.6-1 installed
  • Found database drivers for: MySQL
  • PHP server API is apache2handler; ok, using pretty URLs (index.php/Page_Title)
  • Have XML / Latin1-UTF-8 conversion support.
  • PHP's memory_limit is 50M. If this is too low, installation may fail!
  • Have zlib support; enabling output compression.
  • Couldn't find Turck MMCache, eAccelerator or APC. Object caching functions

cannot be used.

ayg wrote:

The concern appears to be correct, regardless of whether the patch is.
http://www.php.net/manual/en/language.operators.array.php clearly states that
$array1 + $array2 behaves as Keymone says. array_merge() shouldn't cause any
problems, are you sure that it's not your testing procedure at fault?

I tested the "install" procedure twice. I opened config.php once, applied the
patch, and then refreshed config.php. The element at fault is clearly the patch
itself.

keymone wrote:

did you looked at resulting array?

$a + $b will be a union only if it's associated array. in case of simple array:

array(1,2,3,4) + array(5,6,7) == array(5,6,7,4)

it's noted in php help also:
http://www.php.net/manual/en/language.operators.array.php

maybe there is another solution for the problem