phpScheduleIt
May 21, 2013, 05:32:17 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: phpScheduleIt 2.4.2 has been released!
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Summary box problems  (Read 3355 times)
bopper
Newbie
*

Karma: 0
Posts: 4


WWW
« on: September 06, 2006, 12:05:01 PM »

If double quotes are entered in the Summary box when making reservations, the calendar will not show the reservation properely. The reservation link appears with mangled javascript and doesn't function. No javascript pop-up appears either (for obvious reasons).

Similar problem with \ being interpreted inside the Summary.  Have to escape them to have them appear. A \\ will appear as a single \.  If you then edit a reservation, a single \ appears.   Then on saving it will disappear because it is not escaped.

The Summary text box needs to take text literally.  This could also be a SQL injection security hole.
Logged

rguing with an engineer is like mud wrestling a pig:
- after awhile you realize that he's enjoying it.
bopper
Newbie
*

Karma: 0
Posts: 4


WWW
« Reply #1 on: September 06, 2006, 01:12:10 PM »

Replying to my own question, the solution is to use the php function

  htmlentities()

to encode the textarea before insertion into the database.  If necessary, the function

  html_entity_decode()

can be used to return the string to the original form.

Version 1.2.4, please?
Logged

rguing with an engineer is like mud wrestling a pig:
- after awhile you realize that he's enjoying it.
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #2 on: September 06, 2006, 02:24:53 PM »

Sounds like a bug.  Since this is such a small change I'll probably just post the change here for the immediate future.
Logged
bopper
Newbie
*

Karma: 0
Posts: 4


WWW
« Reply #3 on: September 06, 2006, 09:31:36 PM »

Quote from: "Nick"
Sounds like a bug.  Since this is such a small change I'll probably just post the change here for the immediate future.


Unfortunately I tried the htmlentities() function in place of stripslashes() in reserve.php

$res->summary   = stripslashes($_POST['summary']);

but it didn't seem to work for me.  I would say that the summary text should be encoded into HTML entities and stored that way in the database, then converted back after its read from the database.

The reason I'm asking about this is because I want users to be able to put in windows style paths into the summary box, like

c:\tmp\stuff.txt

without having to escape the "\" with "\\", like

c:\\tmp\\stuff.txt

which then disappears after editing the reservation unless they are manually escaped again.  A minor anoyance, but I thought the fix should be an easy one. The use of double quotes in the summary box is more serious because that breaks the javascript and link in the calendar.

Thanks in advance.
Logged

rguing with an engineer is like mud wrestling a pig:
- after awhile you realize that he's enjoying it.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!