aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/pochePictures.php
diff options
context:
space:
mode:
authorNicolas Lœuillet <nicolas.loeuillet@gmail.com>2013-08-02 23:00:57 +0200
committerNicolas Lœuillet <nicolas.loeuillet@gmail.com>2013-08-02 23:00:57 +0200
commit5ffe5cf541d0d1c7524537b034d0cde3da18f6e7 (patch)
tree0d551d7e5550514c97741cdc1544a1206214813f /inc/poche/pochePictures.php
parent8069e235fd2971675ee5fc05026ffa9bce5cbbb7 (diff)
downloadwallabag-5ffe5cf541d0d1c7524537b034d0cde3da18f6e7.tar.gz
wallabag-5ffe5cf541d0d1c7524537b034d0cde3da18f6e7.tar.zst
wallabag-5ffe5cf541d0d1c7524537b034d0cde3da18f6e7.zip
rename pocheTool -> pocheTools
Diffstat (limited to 'inc/poche/pochePictures.php')
-rw-r--r--inc/poche/pochePictures.php12
1 files changed, 4 insertions, 8 deletions
diff --git a/inc/poche/pochePictures.php b/inc/poche/pochePictures.php
index bfc80657..0d73a149 100644
--- a/inc/poche/pochePictures.php
+++ b/inc/poche/pochePictures.php
@@ -15,11 +15,9 @@ function filtre_picture($content, $url, $id)
15{ 15{
16 $matches = array(); 16 $matches = array();
17 preg_match_all('#<\s*(img)[^>]+src="([^"]*)"[^>]*>#Si', $content, $matches, PREG_SET_ORDER); 17 preg_match_all('#<\s*(img)[^>]+src="([^"]*)"[^>]*>#Si', $content, $matches, PREG_SET_ORDER);
18 foreach($matches as $i => $link) 18 foreach($matches as $i => $link) {
19 {
20 $link[1] = trim($link[1]); 19 $link[1] = trim($link[1]);
21 if (!preg_match('#^(([a-z]+://)|(\#))#', $link[1]) ) 20 if (!preg_match('#^(([a-z]+://)|(\#))#', $link[1])) {
22 {
23 $absolute_path = get_absolute_link($link[2],$url); 21 $absolute_path = get_absolute_link($link[2],$url);
24 $filename = basename(parse_url($absolute_path, PHP_URL_PATH)); 22 $filename = basename(parse_url($absolute_path, PHP_URL_PATH));
25 $directory = create_assets_directory($id); 23 $directory = create_assets_directory($id);
@@ -36,8 +34,7 @@ function filtre_picture($content, $url, $id)
36/** 34/**
37 * Retourne le lien absolu 35 * Retourne le lien absolu
38 */ 36 */
39function get_absolute_link($relative_link, $url) 37function get_absolute_link($relative_link, $url) {
40{
41 /* return if already absolute URL */ 38 /* return if already absolute URL */
42 if (parse_url($relative_link, PHP_URL_SCHEME) != '') return $relative_link; 39 if (parse_url($relative_link, PHP_URL_SCHEME) != '') return $relative_link;
43 40
@@ -68,7 +65,6 @@ function get_absolute_link($relative_link, $url)
68/** 65/**
69 * Téléchargement des images 66 * Téléchargement des images
70 */ 67 */
71
72function download_pictures($absolute_path, $fullpath) 68function download_pictures($absolute_path, $fullpath)
73{ 69{
74 $rawdata = get_external_file($absolute_path); 70 $rawdata = get_external_file($absolute_path);
@@ -111,4 +107,4 @@ function remove_directory($directory)
111 } 107 }
112 return rmdir($directory); 108 return rmdir($directory);
113 } 109 }
114} 110} \ No newline at end of file