j4mie / idiorm

A lightweight nearly-zero-configuration object-relational mapper and fluent query builder for PHP5.

Home Page:http://j4mie.github.com/idiormandparis/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

escaping quotes symbols in "_quote_identifier_part"

msangel opened this issue · comments

Method "_quote_identifier_part" do basic escaping - it just wrap raw string by extra quote symbols in end and begining:
return $quote_character . $part . $quote_character;

this code can be broken by string , that already contain $quote_character inside.

Simplest solution will be - just dublicating $quote_character inside of string. In that case we will have valid syntax.

For more details see example with "Hello" on: http://dev.mysql.com/doc/refman/5.1/en/string-literals.html

This tested and work with mySql, but other databeses probably have same behavior.

Thanks for the enhancement request. Fixed in commit 314caf8