Needlworks / Textcube

Textcube : Brand yourself! / Personalized web publishing platform with multi-user support
http://www.textcube.org
Other
208 stars 55 forks source link

MysqlError for filtering homepage url in comments #1694

Closed outsideris closed 10 years ago

outsideris commented 10 years ago

In my error log, there are many Mysql Error like follow

Error message

MysqlError: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '://www.coachfactoryonlineco.us.com LIKE CONCAT('%', LOWER(pattern), '%') LIMIT 1' at line 1

Stack trace

…mysql_query called at /home/outsider/www/blog/framework/data/MySQL/
Adapter.php (245)
…pter::query called at /home/outsider/www/blog/framework/data/MySQL/
Adapter.php (88)
…r::queryExistence called at /home/outsider/www/blog/framework/data/
DBModel.php (177)
…st called at /home/outsider/www/blog/framework/legacy/
Textcube.Data.Filter.php (144)
…er::isAllowed called at /home/outsider/www/blog/library/model/
blog.comment.php (437)
…Comment called at /home/outsider/www/blog/interface/blog/comment/add/
index.php (64)
in include_once called at /home/outsider/www/blog/rewrite.php (11)

I think ://www.coachfactoryonlineco.us.com LIKE CONCAT('%', LOWER(pattern), '%') LIMIT 1 is problem and I guess www.coachfactoryonlineco.us.com is homepage url of comment author.

So, it need to be wrap by quote such like '://www.coachfactoryonlineco.us.com' LIKE CONCAT('%', LOWER(pattern), '%') LIMIT 1

And MySql is 5.5.29 and TextCube is 1.9.3.

outsideris commented 10 years ago

:+1: