Restored compatibility with PHP 5.6
This commit is contained in:
parent
5020f92f18
commit
00a9ae1148
1 changed files with 2 additions and 2 deletions
|
@ -1101,13 +1101,13 @@ if (!defined("DRIVER")) {
|
|||
* @return string
|
||||
*/
|
||||
function unconvert_field($field, $return) {
|
||||
if (preg_match("~binary~", $field["type"] ?? null)) {
|
||||
if (preg_match("~binary~", isset($field["type"]) ? $field["type"] : null)) {
|
||||
$return = "UNHEX($return)";
|
||||
}
|
||||
if (isset($field["type"]) && $field["type"] == "bit") {
|
||||
$return = "CONV($return, 2, 10) + 0";
|
||||
}
|
||||
if (preg_match("~geometry|point|linestring|polygon~", $field["type"] ?? null)) {
|
||||
if (preg_match("~geometry|point|linestring|polygon~", isset($field["type"]) ? $field["type"] : null)) {
|
||||
$prefix = (min_version(8) ? "ST_" : "");
|
||||
$return = $prefix . "GeomFromText($return, $prefix" . "SRID($field[field]))";
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue