Index: trunk/extensions/CodeReview/CodeRevision.php |
— | — | @@ -5,7 +5,7 @@ |
6 | 6 | static function newFromSvn( CodeRepository $repo, $data ) { |
7 | 7 | $rev = new CodeRevision(); |
8 | 8 | $rev->mRepo = $repo->getId(); |
9 | | - $rev->mId = $data['rev']; |
| 9 | + $rev->mId = intval($data['rev']); |
10 | 10 | $rev->mAuthor = $data['author']; |
11 | 11 | $rev->mTimestamp = wfTimestamp( TS_MW, strtotime( $data['date'] ) ); |
12 | 12 | $rev->mMessage = rtrim( $data['msg'] ); |
— | — | @@ -16,8 +16,8 @@ |
17 | 17 | |
18 | 18 | static function newFromRow( $row ) { |
19 | 19 | $rev = new CodeRevision(); |
20 | | - $rev->mRepo = $row->cr_repo_id; |
21 | | - $rev->mId = $row->cr_id; |
| 20 | + $rev->mRepo = intval($row->cr_repo_id); |
| 21 | + $rev->mId = intval($row->cr_id); |
22 | 22 | $rev->mAuthor = $row->cr_author; |
23 | 23 | $rev->mTimestamp = wfTimestamp( TS_MW, $row->cr_timestamp ); |
24 | 24 | $rev->mMessage = $row->cr_message; |
— | — | @@ -127,7 +127,7 @@ |
128 | 128 | } |
129 | 129 | |
130 | 130 | function saveComment( $text, $review, $parent=null ) { |
131 | | - if( !$text ) { |
| 131 | + if( !strlen($text) ) { |
132 | 132 | return 0; |
133 | 133 | } |
134 | 134 | $dbw = wfGetDB( DB_MASTER ); |
Index: trunk/extensions/CodeReview/CodeRevisionView.php |
— | — | @@ -129,7 +129,7 @@ |
130 | 130 | if( $isPreview ) { |
131 | 131 | // Save the text for reference on later comment display... |
132 | 132 | $this->mPreviewText = $text; |
133 | | - } else if( $text ) { // don't save blank comments |
| 133 | + } else if( strlen($text) ) { // don't save blank comments |
134 | 134 | $id = $this->mRev->saveComment( $text, $review, $parent ); |
135 | 135 | |
136 | 136 | // Redirect to the just-saved comment; this avoids POST |