Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2008-07-23 06:22:17

kev wood
New member
Registered: 2008-07-23
Posts: 6

Link Create

I have just tried to create a link form the editor and when i tried to follow the link it had put slashes in the link which were not needed.  Anyone got a quick fix for this?  the link looked like \"www.acmeart.co.uk\"  how can i get rid of the unwanted items from the link

Offline

#2 2008-07-23 09:34:29

kev wood
New member
Registered: 2008-07-23
Posts: 6

Re: Link Create

i am using Xinha as a editor for a newsletter distribution system.  i want the user to be able to addlinks within the text.  the problem as explained in the last post is when the email is opened in the users inbox the link shows up but it has added extra slashes and qutation marks.  is this a xinha problem or could it be because it is being sent in a email.

i though as the link is being crerated in xinha and it is emailed out the link would not be changed.

i am not to good with js so i dont really no were to start looking.  any help would be great.

Offline

#3 2008-07-23 09:53:07

MyLocalFOCUS.com
Xinha Community Member
Registered: 2007-02-17
Posts: 31

Re: Link Create

I would hazard a guess at this being an email problem and the email sender is adding the slashes as an escape mechanism.

Have you tried clicking the Source icon in the editor (the icon that looks like <>  (less than, greater than symbols)) to see if the code has slashes in.

Have you tried saving the content prior to emailing and checking if the saved content has the slashes? This will determine which side the problem is... (emailer or save mechanism). If the save mechanism is adding it, the look at the code that saves the message (sends the email) and see if that is automatically 'escaping' the address. (escaping is the process by which certain characters have to be modified prior to being used in the transfer medium).

Hope this helps.

Offline

#4 2008-07-23 10:49:19

kev wood
New member
Registered: 2008-07-23
Posts: 6

Re: Link Create

i have a preview button so all the information can be viewed before it is sent.  when you view the source on the links before the email is sent this is how they look.  <a href="%5C%22acmeart.co.uk%5C%22">link</a>  and then once the email is sent the  links end up in the browser bar http://\"acmeart.co.uk\"/.

i have just tried it with htt://www.google.com and whenthe email was sent the source for the link was <a target="_blank">link</a> this was the code for the preview page <a href="%5C%22http://www.phpfreaks.com%5C%22" target="\"_blank\"">link</a>.

this is looking to me if it might be a problem with the editor.   it is adding %5C%22 before and at the end of the links that are created and when this is being read by another page it is converting these combinations into \" which is then killing the links.

Offline

#5 2008-07-23 11:30:33

MyLocalFOCUS.com
Xinha Community Member
Registered: 2007-02-17
Posts: 31

Re: Link Create

Is the preview button a server side operation?

%5C is a slash.

My guess is that whatever happens in the preview button is also the same that is happening in the send button. Somehow, the data in the editor is being escaped.

It sounds like it is the quote marks (%22) that are being escaped. What happens if you edit the source code (using the <> button) and replace the quotes with apostrophes? Do they still get escaped?

What is the server side language? Can you post the function of the buttons (send email or preview buttons)? I am thinking that you are encoding the value that is being returned from the editor, or if you are saving it to a database prior to emailing, you are somehow encoding the data from the editor.

Offline

#6 2008-07-24 04:13:41

kev wood
New member
Registered: 2008-07-23
Posts: 6

Re: Link Create

i am using php to code the pages.  the text from the editor is stored in a variable and then this is passed around the different pages that it is used on to display the information.  how can i stop this from happening.

Offline

#7 2008-07-24 04:53:29

MyLocalFOCUS.com
Xinha Community Member
Registered: 2007-02-17
Posts: 31

Re: Link Create

Firstly, you could show your PHP code that handles the storing of the contents of the editor into the variable.
Secondly, you could show us the code that does any processing on that variable.
Thirdly, you could show us the code that handles the preview, which I assume the preview reads that variable.
Fourthly, you could show us the code that handles the email, which again, I assume reads that variable.

I think I can see a common thread developing here. :-)

You need to look around the variable that is storing the output from the editor. Check that no processing is going on with the value, more specifically, check that you are not encoding the value anywhere, or that PHP is handling any encoding.

Something you could try...

In classic ASP (and I am sure there are similar functions in PHP) I could write out the response immediately...

response.write request("xinha")

(xinha is the name of the textarea that hosts xinha).

Then, see if your links are fudged.

Without any background code, I can't help anymore. I am sure it is not xinha that is causing it.

(disclaimer: I am not a xinha developer. I use xinha in my own CMS and have a strong background in server side programming (though not PHP). I am just passing on my experience)

Offline

#8 2008-07-24 05:32:52

kev wood
New member
Registered: 2008-07-23
Posts: 6

Re: Link Create

i have fixed that problem with the stirpslashes function in php.  there is one minor problem still tho.  if i highlight some text for a link and the continue to write more text after the link it continues to use the text after that to use as the link.  can this be stopped or should all the text needed for the links be highlighted once the text as been fully written out. it only happens if no space is put before the text before it is highlighted and made into a link.

Last edited by kev wood (2008-07-24 05:33:47)

Offline

#9 2008-07-28 12:18:00

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: Link Create

Problem #1 is magic_quotes_gpc is turned on in your PHP configuration, this construct is evil, turn it off, code safe PHP.

Problem #2 is a browser behaviour mostly, you can get "stuck" in a link like that if it's the very last thing in the editor.  Switch to html mode and add a letter, or break, or punctuation after the link and then switch back.


James Sleeman

Offline

Board footer

Powered by FluxBB