r61666 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61665‎ | r61666 | r61667 >
Date:15:34, 29 January 2010
Author:nikerabbit
Status:ok
Tags:
Comment:
Don't send requests with empty text to Google

In these cases Google api would give "invalid text" error.
Modified paths:
  • /trunk/extensions/Translate/utils/TranslationHelpers.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/utils/TranslationHelpers.php
@@ -224,6 +224,7 @@
225225 $unsupported = $wgMemc->get( $memckey );
226226
227227 if ( isset( $unsupported[$code] ) ) return null;
 228+ if ( trim( strval( $definition ) ) === '' ) return null;
228229
229230 $path = 'http://ajax.googleapis.com/ajax/services/language/translate?';
230231 $query = array(

Status & tagging log