From 433dfb37faf2cb5c39b17477e1ca952a07be34f5 Mon Sep 17 00:00:00 2001
From: Patrick Barroca <pbarroca@afi-sa.fr>
Date: Thu, 6 Feb 2020 11:55:41 +0100
Subject: [PATCH] hotline #104907 : add PMB thumbnail url detection

---
 VERSIONS_HOTLINE/104907                                   | 1 +
 library/ZendAfi/Validate/VignetteUrl.php                  | 1 +
 tests/library/ZendAfi/View/Helper/Notice/VignetteTest.php | 3 ++-
 3 files changed, 4 insertions(+), 1 deletion(-)
 create mode 100644 VERSIONS_HOTLINE/104907

diff --git a/VERSIONS_HOTLINE/104907 b/VERSIONS_HOTLINE/104907
new file mode 100644
index 00000000000..9b3627cac35
--- /dev/null
+++ b/VERSIONS_HOTLINE/104907
@@ -0,0 +1 @@
+ - ticket #104907 : Vignettes notices : Ajout de règle de détection d'url de vignettes fournies par PMB
\ No newline at end of file
diff --git a/library/ZendAfi/Validate/VignetteUrl.php b/library/ZendAfi/Validate/VignetteUrl.php
index 7aa65bf326e..89d1f093e74 100644
--- a/library/ZendAfi/Validate/VignetteUrl.php
+++ b/library/ZendAfi/Validate/VignetteUrl.php
@@ -28,6 +28,7 @@ class ZendAfi_Validate_VignetteUrl extends Zend_Validate_Abstract {
                             '\/cgi-bin\/koha\/opac-image\.pl\?thumbnail=',
                             'www\.adav-assoc\.com\/.*\/GetImage\/',
                             '\/dam_picture.php\?id=',
+                            '\/getimage.php\?url_image=',
     ];
 
 
diff --git a/tests/library/ZendAfi/View/Helper/Notice/VignetteTest.php b/tests/library/ZendAfi/View/Helper/Notice/VignetteTest.php
index 0cf3af2b289..d89b531eb71 100644
--- a/tests/library/ZendAfi/View/Helper/Notice/VignetteTest.php
+++ b/tests/library/ZendAfi/View/Helper/Notice/VignetteTest.php
@@ -131,7 +131,8 @@ class ZendAfi_View_Helper_Notice_VignetteNoThumbnailTest
             ['http://image-cache.org/34.gif'],
             ['http://image-cache.org/34.jpeg'],
             ['http://image-cache.org/34.jPg'],
-            ['http://www.adAv-Assoc.com/4DACTION/GetImage/207155']
+            ['http://www.adAv-Assoc.com/4DACTION/GetImage/207155'],
+            ['https://pmb.somewhere.net/pmb/getimage.php?url_image=http%3A%2F%2Fimages.server.com%2Fimages%2FP%2F!!isbn!!.08.MZZZZZZZ.jpg&noticecode=9782204134156&vigurl='],
     ];
   }
 
-- 
GitLab