Index: trunk/extensions/CodeReview/backend/CodeRevision.php |
— | — | @@ -834,7 +834,6 @@ |
835 | 835 | public function addReferencesFrom( $revs ) { |
836 | 836 | $data = array(); |
837 | 837 | foreach ( array_unique( (array)$revs ) as $rev ) { |
838 | | - $rev = intval( ltrim( $rev, 'r' ) ); |
839 | 838 | if ( $rev > $this->getId() ) { |
840 | 839 | $data[] = array( |
841 | 840 | 'cf_repo_id' => $this->getRepoId(), |
— | — | @@ -863,7 +862,6 @@ |
864 | 863 | public function addReferencesTo( $revs ) { |
865 | 864 | $data = array(); |
866 | 865 | foreach ( array_unique( (array)$revs ) as $rev ) { |
867 | | - $rev = intval( ltrim( $rev, 'r' ) ); |
868 | 866 | if ( $rev < $this->getId() ) { |
869 | 867 | $data[] = array( |
870 | 868 | 'cf_repo_id' => $this->getRepoId(), |
Index: trunk/extensions/CodeReview/ui/CodeRevisionView.php |
— | — | @@ -52,13 +52,19 @@ |
53 | 53 | $this->mStrikeSignoffs = $wgRequest->getCheck( 'wpStrikeSignoffs' ) ? |
54 | 54 | $this->mSelectedSignoffs : array(); |
55 | 55 | |
56 | | - $this->mAddReference = $wgRequest->getCheck( 'wpAddReferenceSubmit' ) ? |
57 | | - $wgRequest->getArray( 'wpAddReference', array() ) : array(); |
| 56 | + $this->mAddReference = $wgRequest->getCheck( 'wpAddReferenceSubmit' ) |
| 57 | + ? array_map( array( $this, 'ltrimIntval' ), $wgRequest->getArray( 'wpAddReference', array() ) ) |
| 58 | + : array(); |
58 | 59 | |
59 | 60 | $this->mRemoveReferences = $wgRequest->getCheck( 'wpRemoveReferences' ) ? |
60 | 61 | $wgRequest->getIntArray( 'wpReferences', array() ) : array(); |
61 | 62 | } |
62 | 63 | |
| 64 | + private function ltrimIntval( $item ) { |
| 65 | + $item = ltrim( $item, 'r' ); |
| 66 | + return intval( $item ); |
| 67 | + } |
| 68 | + |
63 | 69 | function execute() { |
64 | 70 | global $wgOut, $wgLang; |
65 | 71 | if ( !$this->mRepo ) { |