Links getting messed up

Author Message

Eivind Marienborg

Thursday 19 August 2004 1:48:51 am

I'm using the autolink-function in my forum (like here on the ez.no-site). But when people enter URLs with & / & in them, the link gets messed up.

When "http://www7.nrk.no/nrkplayer/testnettleser.aspx?hovedkategori_id=2&;prosjekt_id=119&kategori_id=0&klipp_id=0&indeks_id=0&oppgave_id=0&sok=&bhcp=1" is entered, it outputs

<a href="http://www7.nrk.no/nrkplayer/testnettleser.aspx?hovedkategori_id=2&amp" title="http://www7.nrk.no/nrkplayer/testnettleser.aspx?hovedkategori_id=2&amp">http://www7.nrk.no/n...?hovedkategori_id=2&amp</a>;prosjekt_id=119&amp;kategori_id=0&amp;klipp_id=0&amp;indeks_id=0&amp;oppgave_id=0&amp;sok=&amp;bhcp=1&quot;&gt;

How can I fix this?

Eivind Marienborg

Thursday 19 August 2004 1:58:56 am

Well that worked well, didn't it..

What happens is that the links gets cut of at the first & , creating bogus links because whatever's behind the & gets cut off. Studying the code, it apperas that it first translates & to &amp;, and then cuts of the link at the ; in the &amp; .

What's the fix for this?

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 06:28:26
Script start
Timing: Jan 31 2025 06:28:26
Module start 'layout'
Timing: Jan 31 2025 06:28:26
Module start 'content'
Timing: Jan 31 2025 06:28:26
Module end 'content'
Timing: Jan 31 2025 06:28:26
Script end

Main resources:

Total runtime0.0125 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 588.1250151.2109
Module start 'layout' 0.00460.0023 739.335936.6484
Module start 'content' 0.00690.0042 775.984490.1563
Module end 'content' 0.01110.0014 866.140629.9922
Script end 0.0125  896.1328 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002419.4910140.0002
Check MTime0.00118.6840140.0001
Mysql Total
Database connection0.00075.318010.0007
Mysqli_queries0.001915.072030.0006
Looping result0.00000.095010.0000
Template Total0.00118.610.0011
Template load0.00086.600910.0008
Template processing0.00021.978610.0002
Override
Cache load0.00064.639410.0006
General
dbfile0.00032.168680.0000
String conversion0.00000.064640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs