01071: CSS class names get repeated for every recognized WikiStyle attribute

Summary: CSS class names get repeated for every recognized WikiStyle attribute
Created: 2009-02-11 16:41
Status: Closed - fixed for 2.2.5
Category: Bug
From: Rogutės?
Assigned:
Priority: 3
Version: 2.2.0
OS:

Description: This markup: %class="many" green% WikiStyle
generates this html: <span class='many many' style='color: green;'> WikiStyle</span>
(the contents of class='...' are repeated for every WikiStyle definition).

Something is obviously wrong with this section inside a while loop in wikistyles.php (lines 123-127):

else {
  $c = @$style['class'];
  $style=array_merge($style,(array)$WikiStyle[$m[1]]);
  if ($c) $style['class'] = $c . ' ' . $style['class'];
}

$style['class'] is assigned to $c and, later on, $c is appended to $style['class']... I guess the parameters of array_merge() call should be adjusted, but I am not sure I understand its purpose.

Oh, and a %class="many" green%nice%% illustration: %class="myspan" frame rfloat bgcolor=blue yellow% WikiStyle

Oh, and a nice illustration: WikiStyle