You are not logged in.
Pages: 1
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
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
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
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
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
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
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
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
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
Pages: 1