r45832 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45831‎ | r45832 | r45833 >
Date:10:41, 17 January 2009
Author:nikerabbit
Status:ok
Tags:
Comment:
* Fix a bug where headers were multiplying
Modified paths:
  • /trunk/extensions/Translate/ffs/Gettext.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/ffs/Gettext.php
@@ -22,8 +22,10 @@
2323 return '';
2424 }
2525 $data = file_get_contents( $this->filename );
26 - $length = strpos( $data, "msgid" );
27 - return substr( $data, 0, $length );
 26+ $start = (int) strpos( $data, '# --');
 27+ if ( $start ) $start += 5;
 28+ $end = (int) strpos( $data, "msgid" );
 29+ return substr( $data, $start, $end-$start );
2830 }
2931
3032 public function parseFile() {

Status & tagging log