Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Char \ in topic subject
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

modifichicci
Average Member

Italy
787 Posts

Posted - 01 March 2008 :  11:06:34  Show Profile  Visit modifichicci's Homepage
I have a strange issue in our modded version.
If I post a topic with subject "\" it is not posted, without error message

If subject is like "\test" it is posted as " est"

It seems that the "\" char is changed to spaces or better the two chars "\t" are changed.

Subject is clean by the chkstring function, and for mysql db it replace "\" with "\\" I think, but this doesn't happens in our version.

it work on my forum (image modded), in this forum, and in a less moded version in access
The db is mysql, but it is mysql also in mine
I have checked post.asp, post_info.asp, inc_func_common.asp and inc_func_posting.asp no changes in routine in all the forums.

Where can i look also?

Variables seems sanitized by the chkstring function, but it seems in subject case it doesn't or it do it in a wrong way.
The same if subject is like "test\test" it is memorized as "test est"

I am realy lost on it now.

Ernia e Laparocele
Forum di Ernia e Laparocele
Acces - MySql Migration Tutorial
Adamantine forum

Edited by - modifichicci on 01 March 2008 11:07:47

phy1729
Average Member

USA
589 Posts

Posted - 01 March 2008 :  11:25:01  Show Profile
Does \n make a newline in the source code? I so \ needs to be escaped to \\. What mods do you have installed? Also does it do the same thing for posts?
Go to Top of Page

modifichicci
Average Member

Italy
787 Posts

Posted - 01 March 2008 :  13:50:26  Show Profile  Visit modifichicci's Homepage
Yes chkstring for mysql escape \ to \\ but not for this variable. only subject is affect message not.
Mods? More than 108.. but the files I have checked haven't difference in treating topic_subject nor in inserting or updating db.

Ernia e Laparocele
Forum di Ernia e Laparocele
Acces - MySql Migration Tutorial
Adamantine forum
Go to Top of Page

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 01 March 2008 :  15:35:21  Show Profile  Send pdrg a Yahoo! Message
\t is almost certainly being treated as a tab character.

Does MySQL have a profiler like MSSQL? Can you catch the SQL en-route to see where it's being called/inserted from? Maybe it's getting inserted just fine, but mis-rendered too - that's another option.
Go to Top of Page

modifichicci
Average Member

Italy
787 Posts

Posted - 01 March 2008 :  15:45:05  Show Profile  Visit modifichicci's Homepage
no it's not inserted in db, variable is changed before the insert or update and if I insert manually in db the \ it is shown ok, but if i try to edit i get a mysql sintax error just in re-writing that sanitized variable.
If I put "\\" as subject, I get "\"

Ernia e Laparocele
Forum di Ernia e Laparocele
Acces - MySql Migration Tutorial
Adamantine forum
Go to Top of Page

phy1729
Average Member

USA
589 Posts

Posted - 01 March 2008 :  16:43:15  Show Profile
In inc_func_common.asp line 435-7 do you have

		Case "sqlstring"
			fString = Replace(fString, "'", "''")
			if strDBType = "mysql" then
				fString = Replace(fString, "\", "\\")
			end if
			fString = HTMLEncode(fString)
			chkString = fString
			exit function
		Case "jsurlpath"
Go to Top of Page

modifichicci
Average Member

Italy
787 Posts

Posted - 01 March 2008 :  16:45:03  Show Profile  Visit modifichicci's Homepage
sure! no difference in the chkstring function in inc_func_common from the original snitz

Ernia e Laparocele
Forum di Ernia e Laparocele
Acces - MySql Migration Tutorial
Adamantine forum
Go to Top of Page

phy1729
Average Member

USA
589 Posts

Posted - 01 March 2008 :  16:48:30  Show Profile
Stupid question but strDBType is "mysql" correct?
Go to Top of Page

modifichicci
Average Member

Italy
787 Posts

Posted - 01 March 2008 :  16:53:16  Show Profile  Visit modifichicci's Homepage
how can i post if not?

Ernia e Laparocele
Forum di Ernia e Laparocele
Acces - MySql Migration Tutorial
Adamantine forum
Go to Top of Page

phy1729
Average Member

USA
589 Posts

Posted - 01 March 2008 :  17:06:10  Show Profile
Only thing I can think of is the title is not being sanitized before going into the db.

Edited by - phy1729 on 01 March 2008 17:07:10
Go to Top of Page

modifichicci
Average Member

Italy
787 Posts

Posted - 01 March 2008 :  17:10:38  Show Profile  Visit modifichicci's Homepage
no subject is sanitized, but in a wrong way or too much if I can say..
\ is deleted with the char near it, but if i put a double \\ one \ is inserted correctly in db

My head is breaking on this fact.. I think a night of a good sleep could help...


Ernia e Laparocele
Forum di Ernia e Laparocele
Acces - MySql Migration Tutorial
Adamantine forum
Go to Top of Page

phy1729
Average Member

USA
589 Posts

Posted - 01 March 2008 :  17:16:00  Show Profile
I don't think the \ is being deleted; it's being interpeted as a control char ex.
\t = tab \n = newline \\ = \ \' = '
Just to make sure try a topic with \' in the title. Sleep usually helps.
Go to Top of Page

modifichicci
Average Member

Italy
787 Posts

Posted - 01 March 2008 :  17:16:28  Show Profile  Visit modifichicci's Homepage
to increase my Headache in private message is the same. If a private message has \ as subject it is not send (but there is the message of pm send!!) and the same thing as in post happens.

Ernia e Laparocele
Forum di Ernia e Laparocele
Acces - MySql Migration Tutorial
Adamantine forum
Go to Top of Page

modifichicci
Average Member

Italy
787 Posts

Posted - 01 March 2008 :  17:19:12  Show Profile  Visit modifichicci's Homepage
\' = no topic posted nor inserted in db,, message of topic posted without error

Ernia e Laparocele
Forum di Ernia e Laparocele
Acces - MySql Migration Tutorial
Adamantine forum
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 01 March 2008 :  21:38:48  Show Profile  Send ruirib a Yahoo! Message
The backslash is an escape character in MySQL, but even that depends on the MySQL version and configuration...You should try to response.write the SQL and then test it against a MySQL DB. If the SQL is ok, problem sorted, if not, then you can fix the SQL and then the code that generates it.

Info on MySQL escape characters: http://dev.mysql.com/doc/refman/5.0/en/string-syntax.html

[rant]By the way, can't Image solve that issue? I'm surprised! He seems to know the answers to just about anything and even comes here and refuses to provide answers to problems he alone can find. You're just lucky that we don't do the same![/rant]



Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

modifichicci
Average Member

Italy
787 Posts

Posted - 02 March 2008 :  03:14:52  Show Profile  Visit modifichicci's Homepage
that is not in Image code, it is in adamantine code.
Image code (and my forum) has not this problem.
I will take a look today . Thank you

Ernia e Laparocele
Forum di Ernia e Laparocele
Acces - MySql Migration Tutorial
Adamantine forum

Edited by - modifichicci on 02 March 2008 03:15:16
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.35 seconds. Powered By: Snitz Forums 2000 Version 3.4.07