html <map> tag

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
dboone
Posts: 5
Joined: Fri May 11, 2007 4:55 pm

html <map> tag

Post by dboone » Tue Jun 26, 2007 11:58 pm

I have an image I want to put in an FAQ with rollovers based upon a map (using the <map> tag). I have been putting the code into the html editor, but when I click the "Update" button it seems to remove the <map> section of code. Is this expected behavior? Is there a way to fix this?
I am using version 2.0.1.
TIA,
Drew

Thorsten
Posts: 15182
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten » Wed Jun 27, 2007 6:34 am

Hi,

how do you add this tag?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

dboone
Posts: 5
Joined: Fri May 11, 2007 4:55 pm

Post by dboone » Wed Jun 27, 2007 2:53 pm

Working in the WYSIWYG editor, I click on the "Edit HTML Source" button. It opens a new window with the html code for my FAQ in it. I add the html code which includes the <map> tag, and click on the "Update" button. The image doesn't show up correctly. I reopen the html source code (by clicking the "Edit HTML Source" button), and the <map> section of code is no longer there.
Thanks,
Drew

matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Post by matteo » Wed Jun 27, 2007 8:50 pm

Hi Drew,
dboone wrote:and the <map> section of code is no longer there.
the reason why Thorsten asked you how did you get the <map> tag is 'cause we filter many HTML tags to prevent XSS injection. If you want to enable that tag look e.g. at this post or e.g. this post.

Ciao,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist

dboone
Posts: 5
Joined: Fri May 11, 2007 4:55 pm

Post by dboone » Mon Jul 02, 2007 7:11 pm

I looked at the first post you referred me to, and I am still not exactly sure what I need to do. (I don't know php, so please excuse my helplessness in this matter)
Do I need to edit both inc/Faq.php and inc/Init.php?
Within the code...

Code: Select all

...
        // remove really unwanted tags
        do {
            $oldstring = $string;
            $string = preg_replace('#</*(applet|meta|xml|blink|link|style|script|embed|object|iframe|frame|frameset|ilayer|layer|bgsound|title|base)[^>]*>#i',"",$string);
        } while ($oldstring != $string);
...
...should I add tags to this list to allow them, or remove them from this list to allow them?
TIA,
Drew

matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Post by matteo » Thu Jul 05, 2007 10:23 am

Hi Drew,
dboone wrote:Do I need to edit both inc/Faq.php and inc/Init.php?
Only inc/Init.php
dboone wrote:...should I add tags to this list to allow them, or remove them from this list to allow them?
This "piped" list contains those tags that will be removed for security reasons.

Ciao,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist

dboone
Posts: 5
Joined: Fri May 11, 2007 4:55 pm

Post by dboone » Mon Jul 09, 2007 5:39 pm

Thanks Matteo. I thought that was what I was supposed to do.

However, the tag that I want to allow is not included in this list. So, it appears that this is NOT the function that is removing the <map> tag.

I hope I am communicating what is happening well enough, and that I have not been unintentionally misleading in my previous posts about the problem. Maybe I should give a more detailed description of what is happening.

I am working to edit an faq entry using the WYSIWYG editor. (I think it is called TinyMCE). I want to add a map to an image that I placed in my faq entry. I select the image and click on the "insert/edit image" button on the tool bar of the WYSIWYG editor and the "insert/edit image" window opens. I click on the "Advanced" tab and enter the name of the map in the "Image Map" field in the Miscellaneous section. I then click the "Update" button and the window closes. So, I have specified the name of the map to be used for this image.

I must now add the map to the html code. So, still working in the WYSIWYG editor, I click on the "Edit HTML Source" button. The "Edit HTML Source" window opens and I add my map code below the img code and I click on the "Update" button. The window closes, but the image and map don't behave as I want the to in the WYSIWYG editor. (i.e. the rollovers I have mapped don't work) So, I click on the "Edit HTML Source" button again to check for errors in the HTML code, but the map section of code I previously added is missing.

So, all of this occurs within the context of editing an faq entry, and not when I "save" the entry I have been editing. (I don't know if I have been explicit about this in previous posts.) So, it seems that the code is being removed by TinyMCE rather than the PHP scripts you pointed me to. (but I could be wrong here)

Thanks for all your help with this problem.

Drew

P.S. I am using FireFox for Mac OS as my browser. I don't know if this matters or not, but I thought I would let you know.

Post Reply