Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#7653 closed defect (bug) (fixed)

Count in wp_sprintf_l() is used, but not defined.

Reported by: jacobsantos's profile jacobsantos Owned by:
Milestone: 2.7 Priority: low
Severity: minor Version: 2.7
Component: General Keywords: has-patch tested commit
Focuses: Cc:


The function checks for the $i variable, which I assume is supposed to be from the count, but is never defined. The condition that uses that variable will always be false all cases. Patch defines the variable, which is hopefully what the developer had in mind.

The note about being greater than 2 items is not checked for and is another bug, I suspect. I suppose the intention is to have the remaining item appended after and break out of the loop, however the only check is a boolean, which is not suffice of a check to ensure this.

Attachments (2)

7653.r8781.diff (591 bytes) - added by jacobsantos 16 years ago.
defines variable based off of r8781.
7653.diff (540 bytes) - added by ryan 16 years ago.
Don't count in loop

Download all attachments as: .zip

Change History (6)

16 years ago

defines variable based off of r8781.

16 years ago

Don't count in loop

#1 @ryan
16 years ago

Patch pulls count out of the loop. That function is rather odd.

#2 @jacobsantos
16 years ago

  • Keywords tested commit added; needs-testing removed

Your patch works for me.

#3 @jacobsantos
16 years ago

Except that it could be that the $i-- belongs at the end. I'll say, an offset mistake is better than a complete malfunction, since it would be an easy change to fix later.

#4 @westi
16 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [9189]) Notice fix and don't count inside a loop. Fixes #7653 props ryan.

Note: See TracTickets for help on using tickets.