r44022 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44021‎ | r44022 | r44023 >
Date:18:07, 28 November 2008
Author:skizzerz
Status:deferred (Comments)
Tags:
Comment:
* If you're going to move the error class out of the messages, at least do it CORRECTLY
Modified paths:
  • /trunk/extensions/AmazonPlus/AmazonPlus.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AmazonPlus/AmazonPlus.php
@@ -100,14 +100,14 @@
101101
102102 $am = new AmazonPlus( $title, $args, $input );
103103 if ( !$am instanceOf AmazonPlus ) {
104 - return wfMsg( $am );
 104+ return '<span class="error">' . wfMsg( $am ) . '</span>';
105105 }
106106 wfSuppressWarnings();
107107 $s = $am->doRequest();
108108 if ( $s === false ) {
109109 return '<span class="error">' . wfMsg( 'amazonplus-nores' ) . '</span>';
110110 } elseif ( $s !== true ) {
111 - return wfMsg( $s );
 111+ return '<span class="error">' . wfMsg( $s ) . '</span>';
112112 }
113113
114114 $ret = $am->getResult();
@@ -135,7 +135,7 @@
136136 }
137137 $id = ( isset( $args['id'] ) ) ? $args['id'] : $this->getId( $title, $args );
138138 if ( !$id ) {
139 - return '<span class="error">' . 'amazonplus-noidres' . '</span>';
 139+ return 'amazonplus-noidres';
140140 }
141141 $this->title = $title;
142142 $this->input = $input;
@@ -197,12 +197,12 @@
198198
199199 $this->response = file_get_contents( $str );
200200 if ( $this->response === false ) {
201 - return '<span class="error">' . 'amazonplus-fgcerr' . '</span>';
 201+ return 'amazonplus-fgcerr';
202202 }
203203
204204 $this->xml = simplexml_load_string( $this->response );
205205 if ( $this->xml === false ) {
206 - return '<span class="error">' . 'amazonplus-slserr' . '</span>';
 206+ return 'amazonplus-slserr';
207207 }
208208
209209 if ( $this->xml->Items->TotalResults == '0' ) {

Comments

#Comment by Aaron Schulz (talk | contribs)   05:48, 3 December 2008

Not sure that comment was necessary

#Comment by Skizzerz (talk | contribs)   21:45, 3 December 2008

Why not? It meant taking a few minutes out of my time fixing someone else's mistake, and it meant that the diff was more than likely not double-checked before the commit to make sure that the changes didn't break anything. Besides, I already talked with siebrand about it and would rather not have a 3rd party intruding into this (already resolved) issue.

Status & tagging log