Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 04-15-2009 11:31:28

Blitzen
Member
From: USA
Registered: 01-01-2005
Posts: 936

Where is the pipe being stripped?

I have entered a pipe symbol, |, into a database field.
When I try to call that field, the pipe symbol gets changed to a space.
I commented it out in database.pl but that doesn't help.
Yes, the pipe is in the database field.

Where is the pipe being converted to a space?

I'm using ...
$sql_statement = "
SELECT optionsel_id,optionsel_selname
FROM optionsel
WHERE optionsel_option=$dbins_id
";

Then, ...
@optionsel = database_call('optionsel','SELECT',$sql_statement);

Right after this database_call, the pipe is changed to a space.

Last edited by Blitzen (04-15-2009 11:35:42)

Offline

 

#2 04-15-2009 11:50:33

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Where is the pipe being stripped?

I'm the wrong person to answer 5.1 questions but I find 3 instances of the vertical bar being changed to a space in database.pl.  Perhaps the one you changed wasn't the correct one.  It is worth mentioning that allowing vertical bars is a little dangerous since that's the pipe character which is why it gets changed.

Offline

 

#3 04-15-2009 11:52:00

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: Where is the pipe being stripped?

At the risk of sounding overly simplistic, it has to be somewhere else (that you didn't comment out) in database.pl or ste_prod.pl.  As far as I know MySQL would let you have the pipe, so CCP must be converting it... and those two places would be the only bits of code associated with your code snippet.  CCP does use pipes in the options hidden fields, so it is distinctly possible that ste_prod.pl is removing it as it is preparing to use it in the option code.


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

#4 04-15-2009 12:17:42

Blitzen
Member
From: USA
Registered: 01-01-2005
Posts: 936

Re: Where is the pipe being stripped?

Dave,
Yes,  I commented it out in three places and quickly tested. It didn't work so I put it back as the original was programmed. I cleared my browser cache before re-testing.

Rachel,
It's not removed in those files.

Like my test showed, the pipe is converted to a space immediately after it's called from the database -  immediately after @optionsel = database_call('optionsel','SELECT',$sql_statement);

You can test it by entering this right after the "database_call" statement and reviewing the source code of that page.
print <<qq;
<!--
$optionsel[0][1]
-->
qq

I guess I'll have to use another character which is a bummer because now I have to reprogram and restructure the database entries that have the pipe.

Last edited by Blitzen (04-15-2009 12:23:23)

Offline

 

#5 04-15-2009 12:55:16

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: Where is the pipe being stripped?

Might be something with the database compilation then... although I'm honestly not sure.  Sorry, ya got me on this one.  Although I will say that pipes in the product options are a bad idea for the reason I mentioned before anyway.


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

#6 04-15-2009 14:21:17

Blitzen
Member
From: USA
Registered: 01-01-2005
Posts: 936

Re: Where is the pipe being stripped?

When I read that field with a generic php file, the pipe is there.
My conclusion is something in CCP5.1 is doing this.

Rachel, I appreciate your concern, but there's no problem because the field that's using it to delimit values in it is a new one. This field has nothing to do with the form elements. It's a long story.

My only question was where it was being removed, and apparently no one knows, so I'll change the delimited value to something else.

Offline

 

#7 04-15-2009 14:27:17

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Where is the pipe being stripped?

Blitzen wrote:

My conclusion is something in CCP5.1 is doing this.

As Rachael said, it may be the Perl database class that is doing it not specifically CCP though it's now moot.

Offline

 

Board footer