Dotclear

Changeset 3754:c16c1cadbae6


Ignore:
Timestamp:
04/30/18 19:00:50 (6 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Use con->syntax rather than con->driver where is useful

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • .hgsubstate

    r3739 r3754  
    1 9d97ea606a4f9a171dfe161c976afda0d524a6d2 inc/libs/clearbricks 
     1ecff2984fb18c7e52f787299d0e78764513bc155 inc/libs/clearbricks 
  • inc/core/class.dc.sql.statement.php

    r3749 r3754  
    142142            $this->from = array(); 
    143143        } 
     144        // Remove comma on beginning of clause(s) (legacy code) 
    144145        if (is_array($c)) { 
    145146            $filter = function ($v) { 
     
    282283    public function regexp($value) 
    283284    { 
    284         if ($this->con->driver() == 'mysql' || $this->con->driver() == 'mysqli' || $this->con->driver() == 'mysqlimb4') { 
     285        if ($this->con->syntax() == 'mysql') { 
    285286            $clause = "REGEXP '^" . $this->escape(preg_quote($value)) . "[0-9]+$'"; 
    286         } elseif ($this->con->driver() == 'pgsql') { 
     287        } elseif ($this->con->syntax() == 'postgresql') { 
    287288            $clause = "~ '^" . $this->escape(preg_quote($value)) . "[0-9]+$'"; 
    288289        } else { 
    289290            $clause = "LIKE '" . 
    290             $sql->escape(preg_replace(array('%', '_', '!'), array('!%', '!_', '!!'), $value)) . 
     291            $this->escape(preg_replace(array('%', '_', '!'), array('!%', '!_', '!!'), $value)) . 
    291292                "%' ESCAPE '!'"; 
    292293        } 
     
    300301     * 
    301302     * if (!$sql->isSame($sql->statement(), $oldRequest)) { 
    302      *    trigger_error('SQL statement error: ' . $sql->statement() . ' / ' .$oldRequest, E_USER_ERROR); 
     303     *     trigger_error('SQL statement error: ' . $sql->statement() . ' / ' . $oldRequest, E_USER_ERROR); 
    303304     * } 
    304305     * 
Note: See TracChangeset for help on using the changeset viewer.

Sites map