]> git.joonet.de Git - adminer.git/commitdiff
fix elastic.inc.php to work on PHP 5.2
authorhelix84 <helix84@centrum.sk>
Fri, 26 Jan 2018 09:25:33 +0000 (10:25 +0100)
committerJakub Vrana <jakub@vrana.cz>
Fri, 26 Jan 2018 15:48:34 +0000 (16:48 +0100)
Without this change, I get the following syntax error on PHP 5.2.6:
PHP Parse error:  syntax error, unexpected ':' in /var/www/adminer/adminer/drivers/elastic.inc.php on line 415

I haven't actually tested the alter_table() method.

adminer/drivers/elastic.inc.php
changes.txt

index 00a6e52581ad01a141e4c3ad0d0b6c5c6b9e7e8f..cdd5e466cedf52e27c24f757d2711255fc36c307 100644 (file)
@@ -412,7 +412,7 @@ if (isset($_GET["elastic"])) {
                $properties = array();
                foreach($fields as $f) {
                        $field_name = trim($f[1][0]);
-                       $field_type = trim($f[1][1] ?: "text");
+                       $field_type = trim($f[1][1] ? "" : "text");
                        $properties[$field_name] = array(
                                'type' => $field_type
                        );
index e566f34b38c378ee3fd565ee097764d5bea76533..e9d5657105025bc9bca50451abd3fbdaf1e88037 100644 (file)
@@ -1,5 +1,6 @@
 Adminer 4.5.1-dev:
 Fix counting selected rows after going back to select page
+PHP <5.3 compatibility even with Elasticsearch enabled
 
 Adminer 4.5.0 (released 2018-01-24):
 Display name of the object in confirmation when dropping it