Firefox PHP

Module: Embed Images

Posted by Maurice Makaay 
Re: Module: Embed Images
June 10, 2008 04:27PM
Maurice,

I'm running version 1.0.6 of this module, a user reported a feed issue:

[forum.xpattern.net]

--
Bert Garcia - When all you have is a keyboard
Re: Module: Embed Images
June 10, 2008 04:54PM
Find the following code in embed_images.php:
                    // Each viewer on the page needs a unique id. We cannot
                    // only use a simple counter for this, because (partial)
                    // messages might be rendered from ajax requests. That
                    // should not result in duplicate ids. This id generation
                    // should give us unique ids.
                    $unique_id = md5(
                        $viewer_id++ . microtime() .$cache_key.$requested_size
                    );

Change that by removing the microtime() call to:
// Each viewer on the page needs a unique id. We cannot
                    // only use a simple counter for this, because (partial)
                    // messages might be rendered from ajax requests. That
                    // should not result in duplicate ids. This id generation
                    // should give us unique ids.
                    $unique_id = md5(
                        $viewer_id++ .$cache_key.$requested_size
                    );

I think that should fix it for you for now. I'll have to look into a method to make that one static. The problem that I had with statically generated ids is that it sometimes gave me troubles when users were embedding images inside spoilers. Maybe I get fix that cleanly now we have a new BBcode module. In the new module, I can use clean callbacks and don't have to parse the full [spoiler] tag tree myself in the module anymore.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Embed Images
June 10, 2008 06:38PM
Thanks Maurice, I made the change.

--
Bert Garcia - When all you have is a keyboard
Re: Module: Embed Images
June 23, 2008 06:31PM
Hi Maurice,

in \embed_images\viewers\dynadrive\code\thumbnailviewer.js are some unescaped closing div-tags (line 9, 20 and 21) causing errors like

File does not exist: /var/www/langzeittest.de/html/intern/phorum-5.2.8-RC1/loading.gif, referer: [forum.langzeittest.de]

Regards
Oliver


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: Module: Embed Images
June 23, 2008 06:54PM
Try module version 1.0.7.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Embed Images
June 24, 2008 09:29PM
Hi Maurice,

Quote
Maurice Makaay
Try module version 1.0.7.

Thanks!

I found some more unescaped closing tags:

\viewers\lightbox\code\js\scriptaculous.js, line 26
\viewers\lightbox\code\js\prototype.js, line 1053 (2x)
\embed_images.js, line 53, 81, 124, 153, 155, 156

Regards
Oliver


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: Module: Embed Images
June 24, 2008 09:50PM
Updated in the 1.0.7 package.

Are you really getting errors because of these or is it just to get the XHTML checks to succeed? There are some standard libraries in there, so it's hard to believe that these cause real troubles.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Embed Images
June 24, 2008 10:22PM
Hi Maurice,

Quote
Maurice Makaay
Are you really getting errors because of these or is it just to get the XHTML checks to succeed? There are some standard libraries in there, so it's hard to believe that these cause real troubles.

Because of our switch to a new web server I'm observing our Apache error log. Some of the unescaped closing tags are causing additional GETs with parts of the corresponding line.

Regards
Oliver


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: Module: Embed Images
July 02, 2008 12:14PM
Hi Maurice,

sometimes my guests are trying to use an IMG-tag with an URL to a web page. The embed image module tries to load that "image" and fails. I think the embed image module shouldn't try go load an URL which is not ending in a graphic file extension.

Example:

[IMG]http://www.tte.de/tuning/website/complete-intro-external.html[/IMG]

Regards
Oliver


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: Module: Embed Images
July 02, 2008 03:00PM
I know, but the case is less simple than you think.
What about


There can be links to dynamic scripts and (god will punish me later) I have at some point written a script graph.html, which produced a graph (it was graph.php, but the stupid sysadmin that managed the system did not want to expose that he had PHP running and linked .html to the php interpreter for that).


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Sorry, only registered users may post in this forum.

Click here to login