r43450 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43449‎ | r43450 | r43451 >
Date:10:49, 13 November 2008
Author:jojo
Status:old
Tags:
Comment:
two checks guarding us against bugs in jQuery UI Sortable
Modified paths:
  • /trunk/extensions/Collection/Collection.body.php (modified) (history)
  • /trunk/extensions/Collection/Collection.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Collection/Collection.php
@@ -228,7 +228,13 @@
229229 function wfAjaxCollectionSetSorting( $items_string ) {
230230 $parsed = array();
231231 parse_str( $items_string, &$parsed );
232 - Collection::setSorting( $parsed['item'] );
 232+ $items = array();
 233+ foreach ( $parsed['item'] as $s ) {
 234+ if ( is_numeric( $s ) ) {
 235+ $items[] = intval( $s );
 236+ }
 237+ }
 238+ Collection::setSorting( $items );
233239 return wfAjaxCollectionGetItemList();
234240 }
235241
Index: trunk/extensions/Collection/Collection.body.php
@@ -284,6 +284,9 @@
285285
286286 static function renameChapter( $index, $name ) {
287287 $collection = $_SESSION['wsCollection'];
 288+ if ( $collection['items'][$index]['type'] != 'chapter ') {
 289+ return;
 290+ }
288291 $collection['items'][$index]['title'] = $name;
289292 $_SESSION['wsCollection'] = $collection;
290293 self::touchSession();

Status & tagging log