Quick Nav:  Online Store   |   Login | Register

PB rule for ampersands in URLs?

Rate this topic:

Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
AuthorMessages
DavidWSnow
<250Posts
Posts:213


07/15/2008 10:06 PM  

John,

I thought that you had said that you had a rule for fixing the &'s in URLs making them xhtml compliant.

I search the rules and found one that addressed ampersands, but not in that context.

Was I dreaming, or do you have such a rule?

 

/DaveS

John Mitchell
Posts:3492


07/18/2008 3:14 PM  

I don't remember, but try this:

Search For:

<a[^>]+href=['"]*[^>]+&(?!amp;)[^'">]+>

Replace With:

&amp;
John Mitchell
Posts:3492


07/18/2008 3:19 PM  

oops, I had my entities mixed up, the previous post has been corrected.

DavidWSnow
<250Posts
Posts:213


08/13/2008 1:58 PM  

I tried it and PB can't save it, but shows no errors.  Changes to other rules work.  Something in this saving this rule is causing a "Thread Aborted" exception.

 

/DaveS

John Mitchell
Posts:3492


08/14/2008 2:21 PM  
It may be a problem with the entity. You can try making the replace With: & amp;amp; (with the space removed between the ampresand and the a).
DavidWSnow
<250Posts
Posts:213


08/15/2008 9:48 PM  

The & amp amp stuff allowed me to save the rule, but didn't make the rule work. the regex is matching the & in the URL from UDT where I am seeing the issue.  replacing with xxx didn't do amything.

 

/DaveS

DavidWSnow
<250Posts
Posts:213


08/29/2008 6:44 PM  

any more suggestions?

/DaveS

John Mitchell
Posts:3492


08/29/2008 6:55 PM  
I don't know why that wouldn't work.
Can you show me an example.
DavidWSnow
<250Posts
Posts:213


08/30/2008 10:48 AM  

http://www.agingsafely.com/help/test_page/testwithpb.aspx is and example.  I added a UDT module with titles and links to documents on my site.  The page was W3C compliante originally. The URL causes several errors with the &'s

 

The PB rule has the "& amp;amp;" with the space removed that you suggested.

 

/DaveS

John Mitchell
Posts:3492


08/30/2008 11:15 AM  

Ok, here is another try.

SearchFor:



(<a [^>]+?&)(?!amp;)



ReplaceWith:

$1amp;
DavidWSnow
<250Posts
Posts:213


08/30/2008 2:42 PM  

No cigar yet!  I did create a URL with the 5-character amp in it and confirmed that it does show up that way in the URL at the bottom of Firefox.  The above strings still leave the 1-car amp.

Maybe this is why DNN never did the URLs with the 5-char amps in the first place

 

/DaveS

John Mitchell
Posts:3492


08/30/2008 2:56 PM  

I don't know how that last one could miss. 

Make sure you have enabled the rule to repeat multiple times, otherwise it will only get the first one it finds.

DavidWSnow
<250Posts
Posts:213


08/30/2008 3:04 PM  
It already was set to repeat 10 times when I set it up. --- DaveS
Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
Forums >Snapsis Product Support >PageBlaster > PB rule for ampersands in URLs?



ActiveForums 3.7
Powered by: Snapsis Software