I m having issues with URL's in fckeditor.
If I enter a URL say:
index.php?ph=1&sub_pg=1
It makes it
index.php?ph=1&sub_pg=1
This makes the URL invalid and crash.
Please let me know how to turn this off.
It is very basic issue and should have an easy fix, since URL's are supposed to have & in them[*]
If I enter a URL say:
index.php?ph=1&sub_pg=1
It makes it
index.php?ph=1&sub_pg=1
This makes the URL invalid and crash.
Please let me know how to turn this off.
It is very basic issue and should have an easy fix, since URL's are supposed to have & in them[*]
Re: URL in Links converts & to & making the URL inva
<a href="/?a=b&c=d">link</a>
If you see a URL like this in the HTML source:
<a href="/?a=b&amp;c=d">link</a>
then your server-side code double-encodes HTML, which would be a bug on your part.
Re: URL in Links converts & to &amp; making the URL inva
I am not a noob and I dont want a noob to reply either plz.
I am talking about URL, link.
For eg. I have a text linking to this post.
The correct HTML would be <a href="http://www.fckeditor.net/forums/posting.php?mode=reply&f=6&t=12464">Click here to visit & reply.</a>
Instead what I get from fckeditor is:
<a href="http://www.fckeditor.net/forums/posting.php?mode=reply&f=6&t=12464">Click here to visit & reply.</a>
Are you getting what I am trying to accomplish here?
Now, if you try and run this URL:
posting.php?mode=reply&f=6&t=12464
It does not compute.
Re: URL in Links converts & to &amp; making the URL inva
Yes, you are a noob and A.M gave you the correct answer.
If you look at the source of this page you will see that every & in any link is written as &
I wonder if someone will be willing to help you in the future and being called a noob due to your ignorance.
Re: URL in Links converts & to &amp; making the URL inva
True words Alfonso!
Re: URL in Links converts & to &amp; making the URL inva
That's pretty funny. I hope you are 12.
Re: URL in Links converts & to &amp; making the URL inva
Ok.
Maybe all of you are not getting what is happening.
And I apologize for my frustration and calling someone noob.
It is not about display, its about HTML code.
Ofcourse the source code here stored & as &
No doubt.
But I am NOT looking to display it as text.
I am talking about HTML being stored in the database.
The client logs in, goes to Fckeditor and adds a link to a line. The link is posting.php?mode=reply&f=6&t=12464
But what is stored in the database is posting.php?mode=reply&f=6&t=12464
And ends up being a broken link to end-user.
I do not want fckeditor to parse the links and encode them as HTML entities. I am ready to assume that the client will enter valid and working links.
I see it as a bug definitely since any non-end-user application would not want this to happen.
Thanks for all your attention (although it was due to reasons separate from the core issue LOL)
Re: URL in Links converts & to &amp; making the URL inva
I don't know whether it's correct HTML or not, but go up the URL line in your web browser right now and change it from:
viewtopic.php?f=6&t=12464
to:
viewtopic.php?f=6&t=12464
and you'll get "The requested topic does not exist." So that doesn't sound very valid to me. Bottom line: you can't change the & in a URL to &. So either this bug in FCKEditor needs to be fixed or I have to stop using FCKEditor because I can't put invalid links onto my web site.
What exactly do you mean by this? A bug on my part where? In the server-side code of the FCKeditor?
Re: URL in Links converts & to &amp; making the URL inva
Even if replacing & with & is valid HTML, I'd still prefer that FCKEditor submit the data as it was entered.
Re: URL in Links converts & to &amp; making the URL inva
For anyone searching now that finds this old post relevant to current issues, here is another twist.
Output filtering by website code might be doubling up CKEditor output after CKEditor is done, and the similarity of the symptom may be misleading you into mistakenly questioning what you forgot was proper HTML encoding. For example, if the common Drupal 6 filter "Pathalogic" is followed by "HTML Filter" or "WYSIWIG Filter", instead of proceeded, proper CKEditor output of "&" in an HREF will be converted to "&&" for display - and the rendered link will fail. Note: in Drupal, despite the naming convention, "input" filters very properly process on "output" (http://drupal.org/node/263002).
Layers of encoding are a always a confusing pain, and tolerant web browser engines have lulled most of us into confusion about required HTML encoding of attributes, including HREF. Since IE has helped me forget to properly encode an href "&" as "&" in a dozen years, I am glad "pranaysharmadelhi" was the one called out and not this old man programmer. Because, I was on route to blame CKEditor as well, and am glad I got to see "pranaysharmadelhi" die first on this page.
Pathalogic users see: http://drupal.org/node/257026, search "Rearrange".
Pathalogic symptom: relative (local) HREFs with "&" render broken "&" links if filter order is wrong.
Re: URL in Links converts & to &amp; making the URL inva
If anyone is still following (or finds) this post I was having a problem with the & being converted to & when it is used inside of a PayPal pay now button.
Here is the code I was using:
I suppose the problem is that the & was being used inside a javascript string... that is definitely a spot you do NOT want your text HTML encoded.
So can that be prevented?
The fix BTW was to just wrap the image in an anchor tag:
Re: URL in Links converts & to &amp; making the URL inva
I've spent hours trying to find a solution to this issue as well. Every answer from the devs seems to amount to "it's working as intended because & always needs to be encoded as &".
I don't think that's accurate, because if you take this very thread, for example:
viewtopic.php?f=6&t=12464
...and then you try to access it with the following URL:
viewtopic.php?f=6&t=12464
...then it errors out. I'm trying to use CKEditor in a phpBB forum (which is what this forum uses). I checked that URL in both Firefox and IE and they both give the same error about an invalid topic.
Note to the devs: This ONLY is an issue using the URL dialog, not when pasting a URL into the editor as I did above. So for example, if you write "Topic About Converting Ampersand", highlight it, and then press the Link toolbar button and paste the desired link, I guarantee it will absolutely not work.
Now on to the real issue: All this discussion is beside the point, in a way. You have a setting "forceSimpleAmpersand" that does not work. That is the REAL point. It doesn't matter whether & or & is "technically" correct. What matters is that the setting results in the desired effect when setting it to "true". If you do not intend to fix the setting, it should be removed.
Re: URL in Links converts & to &amp; making the URL inva
Look at the source code of what you have posted:
As you can see, the first link has & and it works correctly, but in the second one it's doubled encoded, and that's why it doesn't work.
Re: URL in Links converts & to &amp; making the URL inva
When you paste the URL directly in the editor it does NOT double-encode it. When you use the Link dialog to mark text with a URL it DOES double-encode it. That is the issue we're trying to convey to you.
You keep saying it is "our code" that is the issue, but if that was the case then it would also be double-encoding the URLs pasted directly into the editor, but it does not. JUST the URLs created with the Link dialog.
Re: URL in Links converts & to &amp; making the URL inva
OK, I made a test page as pretty clear proof that it is CKEditor causing the double-encoding.
Go to http://lotusfleet.org/cktest.php and do the following steps:
1) On the first line, copy and paste the full URL: http://cksource.com/forums/viewtopic.php?f=6&t=12464
2) On the second line, click the Link toolbar button and paste the full URL.
3) On the third line, type the word "Topic", highlight it, click the Link button and paste the full URL.
4) Hit Submit
5) Click the link "Check CKEditor Message Source"
6) See the following code:
As you can see, the first 2 use simple ampersands as desired. The third one, for some reason, decides it needs to encode it. Now, of course, our CMS is going to parse those incoming & into & so it will be displayed correctly. However, it doesn't know to ignore an already encoded ampersand... why would it? It just parses everything it sees to safely display the results and thus it turns the first 2 into & which work fine, and then turns the 3rd into &amp;
Re: URL in Links converts & to &amp; making the URL inva
One finds a line about forcing simple ampersand so that it can be activated or not, according to the choice of the webmaster:
(or "true")
Would adding this line of code to the config.js file do the trick ? With the settings you wish, of course.
But maybe this has nothing to do with what you are speaking about. I am really no coder and encounter difficulties in understanding technical English. So please be nice and polite if it's completely irrelevant. But tell me.
Re: URL in Links converts & to &amp; making the URL inva
But, if you use CKEditor for building EMAIL MESSAGES, then you do NOT want ampersands to be encoded by the editor. In a common email client like Outlook, if a link contains &, it breaks. This has nothing to do with double-encoding or n00bs.
My solution was to use:
on the page containing my email editor.
Alternately you could put:
in your main editor config.js file if you want this setting to apply to all of your editor instances.