r41683 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41682‎ | r41683 | r41684 >
Date:02:08, 5 October 2008
Author:aaron
Status:old
Tags:
Comment:
Some minor cleanup
Modified paths:
  • /trunk/extensions/CodeReview/CodeRevision.php (modified) (history)
  • /trunk/extensions/CodeReview/CodeRevisionView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeRevision.php
@@ -5,7 +5,7 @@
66 static function newFromSvn( CodeRepository $repo, $data ) {
77 $rev = new CodeRevision();
88 $rev->mRepo = $repo->getId();
9 - $rev->mId = $data['rev'];
 9+ $rev->mId = intval($data['rev']);
1010 $rev->mAuthor = $data['author'];
1111 $rev->mTimestamp = wfTimestamp( TS_MW, strtotime( $data['date'] ) );
1212 $rev->mMessage = rtrim( $data['msg'] );
@@ -16,8 +16,8 @@
1717
1818 static function newFromRow( $row ) {
1919 $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);
2222 $rev->mAuthor = $row->cr_author;
2323 $rev->mTimestamp = wfTimestamp( TS_MW, $row->cr_timestamp );
2424 $rev->mMessage = $row->cr_message;
@@ -127,7 +127,7 @@
128128 }
129129
130130 function saveComment( $text, $review, $parent=null ) {
131 - if( !$text ) {
 131+ if( !strlen($text) ) {
132132 return 0;
133133 }
134134 $dbw = wfGetDB( DB_MASTER );
Index: trunk/extensions/CodeReview/CodeRevisionView.php
@@ -129,7 +129,7 @@
130130 if( $isPreview ) {
131131 // Save the text for reference on later comment display...
132132 $this->mPreviewText = $text;
133 - } else if( $text ) { // don't save blank comments
 133+ } else if( strlen($text) ) { // don't save blank comments
134134 $id = $this->mRev->saveComment( $text, $review, $parent );
135135
136136 // Redirect to the just-saved comment; this avoids POST

Status & tagging log