Gossamer Forum
Home : Products : Others : Fileman :

dealing with things like &

Quote Reply
dealing with things like &
Hi

This is a quick and dirty hack but I have some sites I've done for clients and I've used things like · (&middot Wink and after a page has been edited by FileMan it makes the HTML invalid as · gets changed to ·, the way I have got round it is by adding this stuff to sub edit:

Code:
$lines =~ s/<\/TEXTAREA/<\/TEXT-AREA/ig;
$lines =~ s/&/&amp;/ig;
$lines =~ s/&middot;/&middot;/ig;
$lines =~ s/</&lt;/ig;
$lines =~ s/>/&gt;/ig;
$lines =~ s/&copy;/&copy;/ig;

I'm sure that someone at Gossamer-Threads could come up with some more elegant and something that did not involve a line for each one... perhaps in the next version? Smile

Chris
Quote Reply
Re: dealing with things like &amp;amp; In reply to
Damn that got totally screwed up as the board has the same problems as fileman!

Email me if you want the code!

If I get a chance I'm going to do this as a FileMan mod.

Chris
Quote Reply
Re: dealing with things like &amp;amp; In reply to
I think this is a problem with IE. Basically, if you put text in a textarea box in IE, it will convert it to the symbol. When you submit the information, then IE only sends the symbol, not the & tag.

Let me know if you see a work around..

Cheers,

Alex
Quote Reply
Re: dealing with things like &amp;amp; In reply to
Hi

OK I think what happens is that &nbsp; in a file gets converted into white space when one opens the file in fileman - this is because of the way that textarea fields behave.

This fix seems to work - add in sub edit after $lines =~ s/<\/TEXTAREA/<\/TEXT-AREA/ig;dit, this:

Code:
$lines =~ s/&/&amp;/g;

This causes all &'s to display as &amp;'s in the textarea field and they get saved back OK and one does not end up with invalid HTML Smile

Now this same fix is also needed for Links, DBMan and this discussion forum!

Chris