/** * Returns whether a query is an INSERT query * * @param String $query The query being tested * @return Boolean */ public static function isInsert($query) { $query = (string) $query; $query = \r8\str\stripQuoted($query, array("'", '"', "`")); $query = trim($query); return preg_match("/^\\s*INSERT\\b/i", $query) ? TRUE : FALSE; }
public function testStripQuoted() { $this->assertEquals("This with quotes", \r8\str\stripQuoted("This 'is a string' with\"\" quotes")); $this->assertEquals("This withot", \r8\str\stripQuoted("This /is a string& with/ qu&ot&es", array('/', '&'))); }