summaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2013-09-07 10:13:40 +0100
committerGreg Roach <fisharebest@gmail.com>2013-09-07 10:13:40 +0100
commit1341eca2e0faee6fa591dd1fdc8783a2033db9e5 (patch)
tree6db231248ef97a429b94f4a33ff7165b4ab91acc /library
parent5d6faaeed9b8999432b5edc9cf759301cd04f5f7 (diff)
downloadwebtrees-1341eca2e0faee6fa591dd1fdc8783a2033db9e5.tar.gz
webtrees-1341eca2e0faee6fa591dd1fdc8783a2033db9e5.tar.bz2
webtrees-1341eca2e0faee6fa591dd1fdc8783a2033db9e5.zip
Fix: PHP5.5 compatibility
Diffstat (limited to 'library')
-rw-r--r--library/WT/I18N.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/library/WT/I18N.php b/library/WT/I18N.php
index b6eab39d58..72c9a35b5d 100644
--- a/library/WT/I18N.php
+++ b/library/WT/I18N.php
@@ -95,10 +95,10 @@ class WT_I18N {
$prefs2=array();
foreach ($prefs as $pref) {
list($l, $q)=explode(';q=', $pref.';q=1.0');
- $l=preg_replace(
- array('/-/', '/_[a-z][a-z]$/e'),
- array ('_', 'strtoupper("$0")'),
- $l
+ $l=preg_replace_callback(
+ '/_[a-z][a-z]$/',
+ function($x) { return strtoupper($x[0]); },
+ str_replace('-', '_', $l)
); // en-gb => en_GB
if (array_key_exists($l, $prefs2)) {
$prefs2[$l]=max((float)$q, $prefs2[$l]);