Restored compatibility with PHP 5.6
This commit is contained in:
parent
5020f92f18
commit
00a9ae1148
|
@ -1101,13 +1101,13 @@ if (!defined("DRIVER")) {
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function unconvert_field($field, $return) {
|
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)";
|
$return = "UNHEX($return)";
|
||||||
}
|
}
|
||||||
if (isset($field["type"]) && $field["type"] == "bit") {
|
if (isset($field["type"]) && $field["type"] == "bit") {
|
||||||
$return = "CONV($return, 2, 10) + 0";
|
$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_" : "");
|
$prefix = (min_version(8) ? "ST_" : "");
|
||||||
$return = $prefix . "GeomFromText($return, $prefix" . "SRID($field[field]))";
|
$return = $prefix . "GeomFromText($return, $prefix" . "SRID($field[field]))";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue