Index: trunk/extensions/CentralNotice/SpecialCentralNotice.php |
— | — | @@ -1166,14 +1166,15 @@ |
1167 | 1167 | |
1168 | 1168 | // Start/end don't line up |
1169 | 1169 | if ( $start > $end || $end < $start ) { |
1170 | | - $wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>", 'centralnotice-invalid-date-range3' ); |
1171 | | - return; |
| 1170 | + $wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>", 'centralnotice-invalid-date-range' ); |
| 1171 | + return; |
1172 | 1172 | } |
1173 | 1173 | |
1174 | 1174 | // Invalid campaign name |
1175 | | - $res = $dbr->select( 'cn_notices', 'not_name', array( 'not_name' => $noticeName ) ); |
1176 | | - if ( $dbr->numRows( $res ) < 1 ) { |
| 1175 | + $row = $dbr->selectRow( 'cn_notices', 'not_name', array( 'not_name' => $noticeName ) ); |
| 1176 | + if ( !$row ) { |
1177 | 1177 | $wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>", 'centralnotice-notice-doesnt-exist' ); |
| 1178 | + return; |
1178 | 1179 | } |
1179 | 1180 | |
1180 | 1181 | // Overlap over a date within the same project and language |
— | — | @@ -1181,7 +1182,6 @@ |
1182 | 1183 | $endDate = $dbr->timestamp( $end ); |
1183 | 1184 | |
1184 | 1185 | $dbw = wfGetDB( DB_MASTER ); |
1185 | | - $dbw->begin(); |
1186 | 1186 | $res = $dbw->update( 'cn_notices', |
1187 | 1187 | array( |
1188 | 1188 | 'not_start' => $startDate, |
— | — | @@ -1189,7 +1189,6 @@ |
1190 | 1190 | ), |
1191 | 1191 | array( 'not_name' => $noticeName ) |
1192 | 1192 | ); |
1193 | | - $dbw->commit(); |
1194 | 1193 | } |
1195 | 1194 | |
1196 | 1195 | function updateLock( $noticeName, $isLocked ) { |