Index: trunk/extensions/CodeReview/ui/CodeRevisionView.php |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | $this->mSelectedSignoffs : array(); |
51 | 51 | |
52 | 52 | $this->mAddReference = $wgRequest->getCheck( 'wpAddReferenceSubmit' ) |
53 | | - ? array_map( array( $this, 'ltrimIntval' ), $wgRequest->getArray( 'wpAddReference', array() ) ) |
| 53 | + ? $this->stringToRevList( $wgRequest->getText( 'wpAddReference' ) ) |
54 | 54 | : array(); |
55 | 55 | |
56 | 56 | $this->mRemoveReferences = $wgRequest->getCheck( 'wpRemoveReferences' ) ? |
— | — | @@ -61,10 +61,18 @@ |
62 | 62 | * @return int |
63 | 63 | */ |
64 | 64 | private function ltrimIntval( $item ) { |
65 | | - $item = ltrim( $item, 'r' ); |
| 65 | + $item = ltrim( trim( $item ), 'r' ); |
66 | 66 | return intval( $item ); |
67 | 67 | } |
68 | 68 | |
| 69 | + /** |
| 70 | + * @param $input string |
| 71 | + * @return array |
| 72 | + */ |
| 73 | + private function stringToRevList( $input ) { |
| 74 | + return array_map( array( $this, 'ltrimIntval' ), explode( ',', $input ) ); |
| 75 | + } |
| 76 | + |
69 | 77 | function execute() { |
70 | 78 | global $wgOut, $wgLang; |
71 | 79 | if ( !$this->mRepo ) { |
— | — | @@ -356,8 +364,14 @@ |
357 | 365 | return $list; |
358 | 366 | } |
359 | 367 | |
| 368 | + /** |
| 369 | + * @param $input string |
| 370 | + * @return array|null |
| 371 | + */ |
360 | 372 | protected function splitTags( $input ) { |
361 | | - if ( !$this->mRev ) return array(); |
| 373 | + if ( !$this->mRev ) { |
| 374 | + return array(); |
| 375 | + } |
362 | 376 | $tags = array_map( 'trim', explode( ",", $input ) ); |
363 | 377 | foreach ( $tags as $key => $tag ) { |
364 | 378 | $normal = $this->mRev->normalizeTag( $tag ); |