Logo
        Login with username, password and session length
  Always stay logged in:

Pages: [1]
  Print  
Author Topic: Apostrophes in text input not escaped  (Read 233 times)
lanshark
Newbie
*
Posts: 3

View Profile
« on: April 09, 2009, 12:47:26 PM »

First, nice program!

I'm using v1-rc1.

Declared a table, three columns, one coolumn is varchar(100). When I attempt to add  "Madison's Stuff" to that column, I get the following error: Query Error: near "s": syntax error.

I've tried to use the htmlspecialcharacters, addslashes, and the like from the dropdowns provided, but I am still unable to add text that has an apostrophe in it.

Thanks!

Jim
aldo
Administrator
Newbie
*****
Posts: 41

View Profile WWW
« Reply #1 on: April 15, 2009, 09:58:38 PM »

Sorry about the time it took for a reply!

Thanks for the comment :) Glad you like it.

Anyways, try sqlite_escape_string... The thing with SQLite is, that unlike MySQL, SQLite doesn't escape ' with a \, it escapes it with another ' so to escape ' it gets converted to '' which is what sqlite_escape_string does.

The reason htmlspecialchars doesn't work is the fact that the Quote Style parameter needs to be set to ENT_QUOTES in order to convert ' to the html entity. I suppose I make phpLiterAdmin do that..?
lanshark
Newbie
*
Posts: 3

View Profile
« Reply #2 on: April 22, 2009, 12:09:26 PM »

Aldo,

  No problem on the reply time...

  I tried it with sqlite_escape_string and I still got the same error. If I get some time I'll debug it to find out just where the error is occurring.

  I'll pass along a diff file if I solve it.

Thanks!

Jim
lanshark
Newbie
*
Posts: 3

View Profile
« Reply #3 on: April 22, 2009, 12:18:41 PM »

Aldo,

  It works in 0.90, but not v1-RC1.

  I'm glad I tried the stable release... :)

Cheers!

jim
aldo
Administrator
Newbie
*****
Posts: 41

View Profile WWW
« Reply #4 on: April 22, 2009, 04:00:33 PM »

Okay, so I guess something is wrong with the function calls in v1.0 RC, will look into it ;)

~ UPDATE ~
I believe I found the problem, buildFunctionList had parameters in wrong order :P fixed in SVN, revision 36.
Pages: [1]
  Print  
 
 

Powered by SMF 2.0 RC1-1 | SMF © 2006–2009, Simple Machines LLC
XHTML RSS WAP2
RuNet Theme by [cer]
Page created in 0.187 seconds with 11 queries.