Opened 15 years ago

Closed 15 years ago

#2673 closed Bug (invalid)

Pipe Symbol i.e | is converted to %7c

Reported by: Gerald.J Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

Steps to reproduce:

Create a html file with a href link in that file. for eg:

<a href="http://forum.textpattern.com?f=Hi|hello">Gerald</a>

Paste the above link in a notepad and save that file with extension .html

Open the html file in any browser, press CTRL+A, The content will be copied.

Paste the content in your FCKeditor.

Switch to Source view and see that, the pipe symbol which is in between Hi and hello in the href link gets converted to %7C

Attachments (1)

ger.html (71 bytes) - added by Gerald.J 15 years ago.
Its a Html file. Open in a browser.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 15 years ago by Michael Osipov

Component: Server : JavaGeneral

comment:2 Changed 15 years ago by Artur Formella

Priority: HighNormal

I'm a bit confused. URL term is defined in http://www.ietf.org/rfc/rfc1738.txt :

Other characters are unsafe because
   gateways and other transport agents are known to sometimes modify
   such characters. These characters are "{", "}", "|", "\", "^", "~",
   "[", "]", and "`".

but "|" character passes W3c validation

comment:3 Changed 15 years ago by Michael Osipov

This bahavior seems to be correct.

I wrote a sample code:

package foo;

import java.net.URI;
import java.net.URISyntaxException;

public class Tswt {

	public static void main(String[] args) {

		try {
			URI uri = new URI(null, "http://forum.textpattern.com/?f=Hi|hello",
					null);

			System.out.println(uri.toASCIIString());
		} catch (URISyntaxException e) {
		}

	}
}

The sysout gave me:

http://forum.textpattern.com/?f=Hi%7Chello

This one gives me the same result: http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_encodeURI

Does not seem as a bug to me.

Changed 15 years ago by Gerald.J

Attachment: ger.html added

Its a Html file. Open in a browser.

comment:4 Changed 15 years ago by Gerald.J

Hi

Copy the link http://forum.textpattern.com/?f=Hi|hello and paste it in your Demo FCK editor and switch to see the source code the | symbol will not be changed to %7C.

Same way, Open the html file in any browser which i have attached in this thread (File contains an anchor link). Copy the contents by pressing CTRL+A and paste it your Demo FCK editor and switch to see the source code now the | symbol gets changed to %7C.

Also, when you have opened the html file in browser, place your mouse pointer over the link and see the status bar the URL behind the link will be shown without any change but when u copy the content and place it in the editor | gets changed.

So, I presume editor is changing the symbol and further, if its happening through java coding i can very well replace it via some means.

Expecting any suggestions and ideas for the above issue.

Thanks in advance.

comment:5 in reply to:  2 Changed 15 years ago by Gerald.J

Hi

Copy the link http://forum.textpattern.com/?f=Hi|hello and paste it in your Demo FCK editor and switch to see the source code the | symbol will not be changed to %7C.

Same way, Open the html file in any browser which i have attached in this thread (File contains an anchor link). Copy the contents by pressing CTRL+A and paste it your Demo FCK editor and switch to see the source code now the | symbol gets changed to %7C.

Also, when you have opened the html file in browser, place your mouse pointer over the link and see the status bar the URL behind the link will be shown without any change but when u copy the content and place it in the editor | gets changed.

So, I presume editor is changing the symbol and further, if its happening through java coding i can very well replace it via some means.

Expecting any suggestions and ideas for the above issue.

Thanks in advance.

comment:6 Changed 15 years ago by Michael Osipov

ok, this is what I have done:

  1. Copying http://forum.textpattern.com/viewtopic.php?f=Hi|hello in Rich Mode and then switching to Source Mode results in <p><a href="http://forum.textpattern.com/?f=Hi%7Chello" class="ext-link"><span class="icon">http://forum.textpattern.com/?f=Hi|hello</span></a></p>.
  1. Copying <a href="http://forum.textpattern.com/viewtopic.php?f=Hi|hello">FCK</a> in Source Mode and switching to Rich Mode results in FCK and the pipe remains untouched in the Source Mode.

The question still remains, do you have a problem with that | is converted to %7C?

JavaScript's encodeURI() acts same as Java. Thus I deduct that both are correct and | has to be converted/escaped.

comment:7 Changed 15 years ago by Artur Formella

Resolution: invalid
Status: newclosed

I think it is not a bug because:

-Links

<a href="?test=test|test"> test </a>
<a href="?test=test%7Ctest"> test </a>

loads the same page: ?test=test|test

-There is no difference on PHP side

-"|" character is not safe (http://www.ietf.org/rfc/rfc1738.txt)

-Please create link to http://www.google.pl/search?q=test%7Ctest in Open Office or Google Docs, save as HTML, open source code. "|" is changed to "%7C"

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy