Ask not what osTicket community can do for you - ask what you can do for osTicket community

Go Back   osTicket Forums > Project Tools > osTicket Bug Tracker > Bug

Issue Type Bug   Project osTicket Bug Tracker
Whitespaces in email field
email needs trim() before mysql insert
Category Unknown
Affected Version 1.6 Stable
Priority 6
Status Unconfirmed
Fixed Version (none)
Submitted 03-07-2010
Assigned Users (none) Tags (none)

issueid=189 03-07-2010 05:44 PM
Junior Member
Whitespaces in email field
email needs trim() before mysql insert

When someone creates a new ticket from the web interface, if they were to have white spaces before or after, the white spaces are not trimmed out. Thus not allowing them to login.

I noticed it when a client was unable to login with the correct info. When I went to edit ticket, I noticed two spaces at the end of the email. It was also evident in my test ticket auto response. Note url below:

http://mysupportsite.com/view.php?e=test@test.com &t=346591

To login with test@test.com and 346591 will not work because of the space in the email address.
Reply

03-08-2010 07:04 PM
Junior Member
 
I just started using you script so have not had a whole lot of time to browse through the files but I did make my own edit on class.ticket.php right after:

PHP Code:
//We are ready son...hold on to the rails. 
I needed to get this resolved quickly as my clients seem to always find the bugs easily. Maybe the patch below helps or at least explains the problem I was facing? The most important was the email field.

class.ticket.php.patch
Code:
--- class.ticket.php.save       2010-03-08 18:58:16.000000000 -0500
+++ class.ticket.php    2010-03-08 18:56:02.000000000 -0500
@@ -1308,12 +1308,12 @@
                 ',dept_id='.db_input($deptId).
                 ',topic_id='.db_input($topicId).
                 ',priority_id='.db_input($priorityId).
-                ',email='.db_input($var['email']).
-                ',name='.db_input(Format::striptags($var['name'])).
-                ',subject='.db_input(Format::striptags($var['subject'])).
+                ',email='.db_input(trim($var['email'])).
+                ',name='.db_input(Format::striptags(trim($var['name']))).
+                ',subject='.db_input(Format::striptags(trim($var['subject']))).
                 ',helptopic='.db_input(Format::striptags($topicDesc)).
-                ',phone="'.db_input($var['phone'],false).'"'.
-                ',phone_ext='.db_input($var['phone_ext']?$var['phone_ext']:'').
+                ',phone="'.db_input(trim($var['phone']),false).'"'.
+                ',phone_ext='.db_input($var['phone_ext']?trim($var['phone_ext']):'').
                 ',ip_address='.db_input($ipaddress).
                 ',source='.db_input($source);
Thank you! Great script btw!
Reply
03-09-2010 07:27 AM
Junior Member
 
oH nooooooooooooooooo
Reply
03-10-2010 06:18 AM
Junior Member
 
Thanks for developing this.


Titan 510
Reply

Issue Tools
Subscribe to this issue

All times are GMT -4. The time now is 08:06 PM.