Make WordPress Core

Opened 16 years ago

Closed 15 years ago

#9141 closed defect (bug) (worksforme)

wp_generate_tag_cloud uses wrong decimal seperator

Reported by: toni-p's profile Toni-P Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.7
Component: Template Keywords: needs-patch
Focuses: Cc:

Description

Hi,

I noticed, that wp_generate_Tag_cloud in wp-includes/category-template uses a comma as decimal seperator for font-size values (0,9em). But CSS uses a dot (0.9em). Some Browsers don't render the desired font-size.

I fixed it by patching line 695:

			 ( $smallest + ( ( $count - $min_count ) * $font_step ) ) 

			str_replace(",", ".", ( $smallest + ( ( $count - $min_count ) * $font_step ) ) )

Attachments (1)

r10603.diff (677 bytes) - added by FFEMTcJ 16 years ago.
Fix per instruction

Download all attachments as: .zip

Change History (5)

@FFEMTcJ
16 years ago

Fix per instruction

#1 @FFEMTcJ
16 years ago

  • Keywords has-patch added; tagcloud font size removed

#2 @DD32
16 years ago

The suggested fix isnt very good IMO.

The root cause would be becase the count being passed in is internationalised, and not a int as expected.

I think That could be caused by the internationalisation which happens for the title attr..: http://core.trac.wordpress.org/browser/trunk/wp-includes/category-template.php#L639

I have a feeling the $count variable is being overwritten for some reason when the function is called..

#3 @Denis-de-Bernardy
15 years ago

  • Keywords needs-patch added; has-patch removed
  • Milestone changed from 2.7.2 to 2.8
  • Version set to 2.7

#4 @DD32
15 years ago

  • Milestone 2.8 deleted
  • Resolution set to worksforme
  • Status changed from new to closed

I cant possibly see how the reporters problem is occuring, The only use of $count comes directly from get_terms() which doesnt internationalise the value.. On top of that, a $count with a comma in it, isnt going to be useable with the maths used to come up with the final value.

To me, It sounds like a Plugin conflict, Which is odd, considering the reporters suggested fix.. a value with a comma is NOT going to come out of that math, its as simple as that..

Note: See TracTickets for help on using tickets.