Browse Source

Compatibility issues / 兼容问题

star7th 5 years ago
parent
commit
536640ef21
1 changed files with 1 additions and 1 deletions
  1. 1 1
      server/ThinkPHP/Library/Think/Db/Driver.class.php

+ 1 - 1
server/ThinkPHP/Library/Think/Db/Driver.class.php

@@ -772,7 +772,7 @@ abstract class Driver
 
                 if (preg_match('/^[\w\.]+$/', $key)) {
                     $sort = strtoupper($sort);
-                    $sort = in_array($sort, ['ASC', 'DESC'], true) ? ' ' . $sort : '';
+                    $sort = in_array($sort, array('ASC', 'DESC'), true) ? ' ' . $sort : '';
                     if (strpos($key, '.')) {
                         list($alias, $key) = explode('.', $key);
                         $array[]           = $this->parseKey($alias, true) . '.' . $this->parseKey($key, true) . $sort;