mariovaldez.net

MV.net forums
It is currently 14 Jul 2016, 01:00

All times are UTC - 7 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Strange links
PostPosted: 13 Jul 2004, 01:31 
Hello!

I can't get URL links to work in CM documents.
Having:
<a href="redir.php?cm_elink=http://www.test.com">http://www.test.com</a>
in a "Edit document" window, after saving I get
-CMGT-a href=\-CMDQ-redir.php?cm_elink=http://www.test.com\-CMDQ--CMLT-http://www.test.com-CMGT-/a-CMLT-
in a database. And then opening that document my link looks this way:
http://myserver.com/phprojekt/cm/%5C%22redir.php?cm_elink=http://www.test.com\%22

I use Apache with Oracle database on Windows 2000 server.
If magic quotes matters, my settings in php.ini are:
magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off


Thanks for suggestion / solution in advance!
Benjamin


Report this post
Top
  
Reply with quote  
PostPosted: 13 Jul 2004, 10:33 
User avatar

Joined: 06 Mar 2003, 03:21
Posts: 447
Location: Monterrey, NL, Mexico
Benjamin:

> Hello! I can't get URL links to work in
> CM documents. Having: <a href="redir.php?
> cm_elink=http ://www.test.com">http://www.test.com
> </a> in a "Edit document" window...

Yes, that is expected as external links are converted to be redirected by the redir.php script.


> after saving I get -CMGT-a href=\-CMDQ-redir.php?
> cm_elink=http ://www.test.com\-CMDQ--CMLT-
> http ://www.test.com-CMGT-/a-CMLT- in a database.

This is expected too, as those characters (<, >, ") are converted before being stored in the database. (The purpose of this is that all content in the database is stored as character entities and those characters should be preserved later).


> And then opening that document my link looks
> this way: http ://myserver.com/phprojekt/cm/
> %5C%22redir.php?cm_elink=http://www.test.com\%22

Ok, now that is weird. That link is equivalent to this:
Code:
http://myserver.com/phprojekt/cm/\"redir.php?cm_elink=http://www.test.com\"


The link reference is quoted and the quotes are escaped.

This escaping is happening after the data is extracted from the database, as the links in the database are not escaped.


> I use Apache with Oracle database on Windows 2000 server.
> If magic quotes matters, my settings in php.ini are:
> magic_quotes_gpc = Off
> magic_quotes_runtime = Off
> magic_quotes_sybase = Off
> Thanks for suggestion / solution in advance!
> Benjamin

The CMS has not been tested on Oracle (at least by me). I will try to replicate your configuration to search for an answer. Benjamin, in the mean time try the following:

In the script cm/display.php, around line 136, 141, and 147 wrap the fcm_process_markup function call with the stripslashes function so that it looks like this:
Code:
echo stripslashes (fcm_process_markup (fcm_secure_html (fcm_decode_htmlfull ($row1[2])), $cm_path, true));


...like this:
Code:
echo stripslashes (fcm_process_markup (fcm_htmlentity (fcm_decode_html ($row1[2])), $cm_path, false));


...and like this:
Code:
echo stripslashes (fcm_process_markup ($row1[2], $cm_path, false));



Then tell me if it worked.

Regards,

Mario A. Valdez-Ramirez.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: 13 Jul 2004, 15:33 
User avatar

Joined: 06 Mar 2003, 03:21
Posts: 447
Location: Monterrey, NL, Mexico
Benjamin:

I forgot to ask, what version of the CMS, what version of Phprojekt, and what version of PHP are you using?


Regards,

Mario A. Valdez-Ramirez.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 13 Jul 2004, 23:12 
Hello Mario!

Thanks for your quick and detailed answer. Links are working now very good. :-)

> I forgot to ask, what version of the CMS, what version of Phprojekt, and what version of PHP are you using?
This is from my browser:
C: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040614 Firefox/0.8
S: CMS4P/0.6.0b12 Phprojekt/4.2 Oracle Oracle/unknown Windows

and PHP is PHP Version 4.3.7

Best regards!
Benjamin


Report this post
Top
  
Reply with quote  
 Post subject: Good it's fixed...
PostPosted: 14 Jul 2004, 03:33 
User avatar

Joined: 06 Mar 2003, 03:21
Posts: 447
Location: Monterrey, NL, Mexico
Benjamin:

> Thanks for your quick and detailed answer.
> Links are working now very good. Smile
> This is from my browser:
> C: Mozilla/5.0 (Windows; U; Windows NT
> 5.1; en-US; rv:1.7) Gecko/20040614 Firefox/0.8
> S: CMS4P/0.6.0b12 Phprojekt/4.2 Oracle
> Oracle/unknown Windows
> and PHP is PHP Version 4.3.7

Hello again. Good to know it is fixed now. :D

So, it was the stripslashes change needed or it was fixed by doing something else?

Also, thanks for the extra data. I was wondering if you downloaded the 0.6.0 stable release or if you are really using the 0.6.0beta 12. (Because of a bug in 0.6.0, it reports itself as being 0.6.0b12).

Thanks,

Mario A. Valdez-Ramirez.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 14 Jul 2004, 05:54 
Actually, it is cm4p_0.6.0.zip file which I downloaded.
And the solution was as you told me: by adding stripslashes.

Thanks again!

Benjamin


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 7 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group