Index: trunk/phase3/includes/api/ApiFormatBase.php |
— | — | @@ -172,13 +172,6 @@ |
173 | 173 | protected function formatHTML($text) { |
174 | 174 | // Escape everything first for full coverage |
175 | 175 | $text = htmlspecialchars($text); |
176 | | - |
177 | | - /* Temporary fix for bad links in help messages. As a special case, XML-escaped |
178 | | - * ampersands are de-escaped one level in the help message for legibility. |
179 | | - * Should be removed once we have completed a fully-html version of the |
180 | | - * help message. */ |
181 | | - if ( $this->mUnescapeAmps ) |
182 | | - $text = str_replace( '&', '&', $text ); |
183 | 176 | |
184 | 177 | // encode all comments or tags as safe blue strings |
185 | 178 | $text = preg_replace('/\<(!--.*?--|.*?)\>/', '<span style="color:blue;"><\1></span>', $text); |
— | — | @@ -191,6 +184,13 @@ |
192 | 185 | $text = ereg_replace("\\*[^<>\n]+\\*", '<b>\\0</b>', $text); |
193 | 186 | // make strings inside $ italic |
194 | 187 | $text = ereg_replace("\\$[^<>\n]+\\$", '<b><i>\\0</i></b>', $text); |
| 188 | + |
| 189 | + /* Temporary fix for bad links in help messages. As a special case, |
| 190 | + * XML-escaped metachars are de-escaped one level in the help message |
| 191 | + * for legibility. Should be removed once we have completed a fully-html |
| 192 | + * version of the help message. */ |
| 193 | + if ( $this->mUnescapeAmps ) |
| 194 | + $text = preg_replace( '/&(amp|quot|lt|gt);/', '&\1;', $text ); |
195 | 195 | |
196 | 196 | return $text; |
197 | 197 | } |