r96337 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96336‎ | r96337 | r96338 >
Date:14:57, 6 September 2011
Author:reedy
Status:ok
Tags:
Comment:
* (bug 30254) Adding multiple revisions manually as followups to a revision doesn't work

Add some documentation too
Modified paths:
  • /trunk/extensions/CodeReview/ui/CodeRevisionView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/ui/CodeRevisionView.php
@@ -49,7 +49,7 @@
5050 $this->mSelectedSignoffs : array();
5151
5252 $this->mAddReference = $wgRequest->getCheck( 'wpAddReferenceSubmit' )
53 - ? array_map( array( $this, 'ltrimIntval' ), $wgRequest->getArray( 'wpAddReference', array() ) )
 53+ ? $this->stringToRevList( $wgRequest->getText( 'wpAddReference' ) )
5454 : array();
5555
5656 $this->mRemoveReferences = $wgRequest->getCheck( 'wpRemoveReferences' ) ?
@@ -61,10 +61,18 @@
6262 * @return int
6363 */
6464 private function ltrimIntval( $item ) {
65 - $item = ltrim( $item, 'r' );
 65+ $item = ltrim( trim( $item ), 'r' );
6666 return intval( $item );
6767 }
6868
 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+
6977 function execute() {
7078 global $wgOut, $wgLang;
7179 if ( !$this->mRepo ) {
@@ -356,8 +364,14 @@
357365 return $list;
358366 }
359367
 368+ /**
 369+ * @param $input string
 370+ * @return array|null
 371+ */
360372 protected function splitTags( $input ) {
361 - if ( !$this->mRev ) return array();
 373+ if ( !$this->mRev ) {
 374+ return array();
 375+ }
362376 $tags = array_map( 'trim', explode( ",", $input ) );
363377 foreach ( $tags as $key => $tag ) {
364378 $normal = $this->mRev->normalizeTag( $tag );

Status & tagging log