[SPIP Zone] r4203 - in /_plugins_: lightbox_v1/lightbox_js.html thickbox/thickbox.js

Author: fil@rezo.net
Date: Mon Jul 24 11:51:31 2006
New Revision: 4203

Log:
bug sur les urls contenant 'jpg' mais n'etant pas des images

Modified:
    _plugins_/lightbox_v1/lightbox_js.html
    _plugins_/thickbox/thickbox.js

Modified: _plugins_/lightbox_v1/lightbox_js.html

--- _plugins_/lightbox_v1/lightbox_js.html (original)
+++ _plugins_/lightbox_v1/lightbox_js.html Mon Jul 24 11:51:31 2006
@@ -296,7 +296,7 @@
     || ((anchor.getAttribute("type")
       && anchor.getAttribute("type").match(/^image\/(jpeg|png|gif)$/i))
       || (!anchor.getAttribute("type")
- && anchor.getAttribute("href").match(/\.(jpg|jpeg|png|gif)/i)
+ && anchor.getAttribute("href").match(/^[^?]+\.(jpg|jpeg|png|gif)$/i)
       )
       )
     )) {

Modified: _plugins_/thickbox/thickbox.js

--- _plugins_/thickbox/thickbox.js (original)
+++ _plugins_/thickbox/thickbox.js Mon Jul 24 11:51:31 2006
@@ -23,7 +23,7 @@
       this.type
         ? this.type.match(/image[/](jpeg|gif|png)/i)
         : (this.href
- ? this.href.match(/\.(jpeg|jpg|gif|png)$/i)
+ ? this.href.match(/^[^?]+\.(jpeg|jpg|gif|png)$/i)
           : false
         )
       ) {

salut,
fil@rezo.net wrote:

Author: fil@rezo.net
Date: Mon Jul 24 11:51:31 2006
New Revision: 4203

Log:
bug sur les urls contenant 'jpg' mais n'etant pas des images

Ca se fait pa en js un truc comme calculer les dimensions de l'image,
genre courament utilisé en php pour filtrer des merdes évidentes ?

Ca vaut même pô 0,02 € :slight_smile:
--
toggg

Ca se fait pa en js un truc comme calculer les dimensions de l'image,
genre courament utilisé en php pour filtrer des merdes évidentes ?

Il y a ça dans la thickbox, qui preloade l'image, et intègre ensuite le div
à la bonne taille... avec des problèmes constatés sous FF.

Dans la lightbox_V1 il y a pas

-- Fil