[TYPO3] Typolink parsing links incorrectly

Bernd Wilke xoonsji02 at sneakemail.com
Sat Feb 24 04:09:44 CET 2007


On Fri, 23 Feb 2007 15:21:54 -0800, Christopher Torgalson wrote
with subject "Re: [TYPO3] Typolink parsing links incorrectly":

> Hi,
> 
> On 2/23/07, Bernd Wilke <xoonsji02 at sneakemail.com> wrote:
> > On Fri, 23 Feb 2007 13:45:49 -0800, Christopher Torgalson wrote
> > with subject "Re: [TYPO3] Typolink parsing links incorrectly":
> 
> <snip>
> 
> > > Can you elaborate about the problems you're referring to?
> >
> > in your example the URL is generated inside the javascript.
> > I refer to the output of typo3 if you use a image with 'click to
> > enlarge'-link.
> >
> > the output is soemthing like:
> > <a href="#"
> > onclick="vHWin=window.open('index.php?id=200&L=0','FEopenLink','width=1040,height=750');vHWin.focus();return
> > false;"><img src="fileadmin/preview.gif" alt="" align="right" border="0"
> > height="117" width="80"></a>
> > (I think this is the output of a "link in a new window" generated with rte)
> >
> > here the URL is hardcoded in javascript and should read
> > onclick="vHWin=window.open('index.php?id=200&amp;L=0','FEopenLink','width=1040,height=750');vHWin.focus();return
> > false;"
> > for correct XHTML. The ampersand has to be coded in any HTML-paramter.
> > Giving javascript this URL, you get valid XHTML, but only errors from
> > javascript.
> 
> 
> I still can't tell what you mean--the two samples of code don't behave
> the slightest bit differently wrt javascript as far as I can see...

onclick="vHWin=window.open('index.php?id=200&amp;L=0');

won't open the Window with the URL 'index.php?id=200&L=0' but with the URL
'index.php?id=200&amp;L=0' and the server gets it wrong, because it's not
the server which replaces the expansion but the browser. and from the
javascript the URL is transmitted unmodified.

if you don't have a second GET-param you won't get an error. or if you use
realurl to hide all the params.

I came to this while building extensions with javascript-output. Generating
links with core-functions returnes &amp;.
After crashing several times I replace them now for the javascript with &:

$jsUrl = str_replace(array('%5b','%5d','&amp;'),array('[',']','&'),$URL);

Bernd

-- 
http://www.bernd-wilke.net


More information about the TYPO3-english mailing list