[wp-trac] [WordPress Trac] #11725: Add start and count attributes to gallery shortcode

WordPress Trac wp-trac at lists.automattic.com
Wed Jan 6 08:00:36 UTC 2010


#11725: Add start and count attributes to gallery shortcode
-----------------------------+----------------------------------------------
 Reporter:  frymi            |       Owner:             
     Type:  feature request  |      Status:  new        
 Priority:  normal           |   Milestone:  Unassigned 
Component:  Gallery          |     Version:  2.9.1      
 Severity:  normal           |    Keywords:  needs-patch
-----------------------------+----------------------------------------------

Comment(by nacin):

 Lines 698-700 - commas should be after the array items, not before.

 Comment on 760 isn't necessary (or should be intended and lowercased).

 count() call on 762 should be lowercase.

 We use || and &&, not OR and AND. (Not just for consistency, either --
 they work differently,as PHP places them at different spots in operator
 precedence.)

 The continue statement is fine for < $start, but if we've gone beyond
 $start + $count, we should break instead that way we don't keep running
 the loop when we don't need to.

 Though I haven't tested it, the logic looks like it would work fine. I
 would probably sanitize $count early though, instead of making numerous
 casts and checks throughout. And $start isn't sanitized at all. We have a
 function absint() that could help.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11725#comment:12>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list