Index: trunk/extensions/LocalisationUpdate/LocalisationUpdate.php |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | |
30 | 30 | // If the key also contains the language code remove the language code from the key |
31 | 31 | if($isFullKey) { |
32 | | - $lckey = eregi_replace("/".$langcode,"",$lckey); |
| 32 | + $lckey = preg_replace("/\/".$langcode."/","",$lckey); |
33 | 33 | } |
34 | 34 | |
35 | 35 | //If message is in the cache, don't get an update! |
— | — | @@ -166,8 +166,8 @@ |
167 | 167 | //Remove all unneeded content |
168 | 168 | function cleanupFile($contents) { |
169 | 169 | //We don't need any PHP tags |
170 | | - $contents = eregi_replace("<\?php","",$contents); |
171 | | - $contents = eregi_replace("\?>","",$contents); |
| 170 | + $contents = preg_replace("/<\\?php/","",$contents); |
| 171 | + $contents = preg_replace("/\?>/","",$contents); |
172 | 172 | $results = array(); |
173 | 173 | //And we only want the messages array |
174 | 174 | preg_match("/\\\$messages(.*\s)*?\);/",$contents,$results); |
— | — | @@ -180,7 +180,7 @@ |
181 | 181 | } |
182 | 182 | |
183 | 183 | //Windows vs Unix always stinks when comparing files |
184 | | - $contents = eregi_replace("\\\r","",$contents); |
| 184 | + $contents = preg_replace("/\\\r/","",$contents); |
185 | 185 | |
186 | 186 | //return the cleaned up file |
187 | 187 | return $contents; |
— | — | @@ -219,7 +219,7 @@ |
220 | 220 | $basefilecontents = cleanupFile($basefilecontents); |
221 | 221 | |
222 | 222 | //Change the variable name |
223 | | - $basefilecontents = eregi_replace("\\\$messages","\$base_messages",$basefilecontents); |
| 223 | + $basefilecontents = preg_replace("/\\\$messages/","\$base_messages",$basefilecontents); |
224 | 224 | |
225 | 225 | $basehash = md5($basefilecontents); |
226 | 226 | //If this is the remote file check if the file has changed since our last update |
— | — | @@ -256,7 +256,7 @@ |
257 | 257 | $comparefilecontents = cleanupFile($comparefilecontents); |
258 | 258 | |
259 | 259 | //rename the array |
260 | | - $comparefilecontents = eregi_replace("\\\$messages","\$compare_messages",$comparefilecontents); |
| 260 | + $comparefilecontents = preg_replace("/\\\$messages/","\$compare_messages",$comparefilecontents); |
261 | 261 | |
262 | 262 | $comparehash = md5($comparefilecontents); |
263 | 263 | //If this is the remote file check if the file has changed since our last update |
— | — | @@ -339,8 +339,8 @@ |
340 | 340 | |
341 | 341 | function cleanupExtensionFile($contents) { |
342 | 342 | //We don't want PHP tags |
343 | | - $contents = eregi_replace("<\?php","",$contents); |
344 | | - $contents = eregi_replace("\?>","",$contents); |
| 343 | + $contents = preg_replace("/<\?php/","",$contents); |
| 344 | + $contents = preg_replace("/\?>/","",$contents); |
345 | 345 | $results = array(); |
346 | 346 | //And we only want message arrays |
347 | 347 | preg_match_all("/\\\$messages(.*\s)*?\);/",$contents,$results); |
— | — | @@ -348,7 +348,7 @@ |
349 | 349 | $contents = implode("\n\n",$results[0]); |
350 | 350 | |
351 | 351 | //And we hate the windows vs linux linebreaks |
352 | | - $contents = eregi_replace("\\\r","",$contents); |
| 352 | + $contents = preg_replace("/\\\r/","",$contents); |
353 | 353 | return $contents; |
354 | 354 | } |
355 | 355 | |
— | — | @@ -378,7 +378,7 @@ |
379 | 379 | $basefilecontents = cleanupExtensionFile($basefilecontents); |
380 | 380 | |
381 | 381 | //Rename the arrays |
382 | | - $basefilecontents = eregi_replace("\\\$messages","\$base_messages",$basefilecontents); |
| 382 | + $basefilecontents = preg_replace("/\\\$messages/","\$base_messages",$basefilecontents); |
383 | 383 | |
384 | 384 | $basehash = md5($basefilecontents); |
385 | 385 | //If this is the remote file |
— | — | @@ -416,7 +416,7 @@ |
417 | 417 | $comparefilecontents = cleanupExtensionFile($comparefilecontents); |
418 | 418 | |
419 | 419 | //Rename the array |
420 | | - $comparefilecontents = eregi_replace("\\\$messages","\$compare_messages",$comparefilecontents); |
| 420 | + $comparefilecontents = preg_replace("/\\\$messages/","\$compare_messages",$comparefilecontents); |
421 | 421 | $comparehash = md5($comparefilecontents); |
422 | 422 | if(preg_match("/^http/",$comparefile) && !$alwaysGetResult) { |
423 | 423 | //Check if the remote file has changed |