Hi,

When I try to edit a banner, I get a large mysql error. However, it still seems to update. On dumping the keys and values, there is one that seems to slip in there and the q parameter comes out as:

0='%s'

I'm not entirely sure how it slips by the check (I'm assuming it ends up checking if there is a position 0?) but ensuring that key!=0 seems to do the trick.

CommentFileSizeAuthor
#2 banner_module.patch1.64 KBplj

Comments

gatta’s picture

Title: Minor bug with editing a banner » bug with editing a banner
Priority: Minor » Critical

I tried to change the status of a banner from enabled to disabled and I got the following MySQL error:

user warning: 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 '0='' WHERE vid=155' at line 1 query: UPDATE banner SET nid=155,vid=155,url='http://somedomain.com/node/31',frame_target='_none',workflow=4,mode=0,banner_content='',cache='document.write(\' <a href=\"/banner/155\" title=\"http://somedomain.com/node/31\"><img src=\"http://somedomain.com/files/victoria_self2.gif\" width=\"596\" height=\"70\" alt=\"\" /></a>\');',notify_day=0,notify_week=0,notify_failed=0,notify_send=0,notify_sent=0,chance=1,clicks_max=0,views_max=0,views_week_max=0,
views_day_max=0,views=570,views_week=326,views_day=50,clicks=3,clicks_week=1,clicks_day=0,width=596,height=70,0='' WHERE vid=155 in /home/user/www/includes/database.mysql.inc on line 172.

The 0='' added is similar to what BTMash described. But the banner status was not being changed.

plj’s picture

StatusFileSize
new1.64 KB

I've made a quick and dirty fix for this problem for those who, like me, are already familiar with Banner and need some working stuff Right Now.
But I think that most people should abandon Banner and migrate to Ad as soon as possible.