Welcome to Geeklog Friday, May 24 2013 @ 07:07 PM EDT
|
||||||||
![]() |
Forum Index > General Discussions > Feedback |
New Topic
|
Post Reply
|
Problem with too long a group name |
|||
| mystral-kk |
|
||||||
![]() ![]() ![]() ![]() ![]() Regular Poster ![]() Status: offline ![]() Registered: 03/19/06 Posts: 89 |
Hi all,
I know this is rather a rare case, but it can cause a disastrous malfunction. How about checking the length of strings before saving them into DB? -- mystral-kk, "Every cloud has a silver lining." |
||||||
|
|||||||
| Dirk |
|
||||||
![]() ![]() ![]() ![]() ![]() Admin ![]() Status: offline ![]() Registered: 01/12/02 Posts: 13027 |
Thanks for the report. This certainly shouldn't happen.
I've added a quick sanity check for now, but this needs more in-depth research to find out what exactly is going wrong and what we could do about it. bye, Dirk |
||||||
|
|||||||
| mystral-kk |
|
||||||
![]() ![]() ![]() ![]() ![]() Regular Poster ![]() Status: offline ![]() Registered: 03/19/06 Posts: 89 |
Thanks for the quick reply, Dirk. We hope you'll come up with a nice solution.
-- mystral-kk, "Every cloud has a silver lining." |
||||||
|
|||||||
| jmucchiello |
|
||||||
![]() ![]() ![]() ![]() ![]() Full Member Status: offline ![]() Registered: 08/29/05 Posts: 985 |
PHP Formatted Code // line 465-8 of admin/group.phpDB_save ($_TABLES['groups'], 'grp_name,grp_descr,grp_gl_core', "'$grp_name','$grp_descr',$grp_gl_core"); $grp_id = DB_getItem ($_TABLES['groups'], 'grp_id', "grp_name = '$grp_name'"); The DB_getItem is the culprit. gl_groups uses an auto_incrememt primary key and as such you should be calling DB_insertId() to get that id back from the call to DB_save. PHP Formatted Code // This code is susceptible to the same error(on line 442-4)// group names have to be unique, so check if this one exists already $g_id = DB_getItem ($_TABLES['groups'], 'grp_id', "grp_name = '$grp_name'"); No sure how you fix that off the top of my head. Probably need to do something like: "grp_name = '" . substr($grp_name,0,50) . "'" |
||||||
|
|||||||
| Content generated in: 0.97 seconds |
|
|
|