Skip to content

Commit 062d1a0

Browse files
authored
PHP 5.0 syntax
What I had earlier thought was Python-like code was actually PHP using syntax effective with version 5.4+. Piwigo itself requires only PHP 5.0 or higher. So it looks like issue #107 is that the Piwigo server may be running a lower PHP version than 5.4. My host, for example, runs PHP 5.2; don't ask why. The unattractive syntax in this commit should work with any PHP 5.0+.
1 parent 017980e commit 062d1a0

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

admin/admin_tag.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
if ( $tag_groups == 1 and isset($_POST['osm_tag_submit']) )
6464
{
6565
// Override default value from the form
66+
$tmp = preg_split("/_/",$_POST['language']);
6667
$sync_options = array(
6768
'overwrite' => isset($_POST['overwrite']),
6869
'simulate' => isset($_POST['simulate']),
@@ -77,7 +78,7 @@
7778
'osm_tag_address_country' => isset($_POST['osm_tag_address_country']),
7879
'osm_tag_address_postcode' => isset($_POST['osm_tag_address_postcode']),
7980
'osm_tag_address_country_code' => isset($_POST['osm_tag_address_country_code']),
80-
'language' => preg_split("/_/",$_POST['language'])[0]
81+
'language' => $tmp[0],
8182
);
8283

8384
// TODO allow to filter on overwrite
@@ -211,7 +212,7 @@
211212
//print_r($tag_ids);
212213
if (!empty($tag_ids))
213214
{
214-
add_tags($tag_ids, [$image['id']]);
215+
add_tags($tag_ids, array($image['id']));
215216
}
216217
}
217218
$datas[] = $image['id'];

0 commit comments

Comments
 (0)