diff options
author | Nicolas Lœuillet <nicolas.loeuillet@gmail.com> | 2013-08-02 23:00:57 +0200 |
---|---|---|
committer | Nicolas Lœuillet <nicolas.loeuillet@gmail.com> | 2013-08-02 23:00:57 +0200 |
commit | 5ffe5cf541d0d1c7524537b034d0cde3da18f6e7 (patch) | |
tree | 0d551d7e5550514c97741cdc1544a1206214813f /inc/poche/pochePictures.php | |
parent | 8069e235fd2971675ee5fc05026ffa9bce5cbbb7 (diff) | |
download | wallabag-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.php | 12 |
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 | */ |
39 | function get_absolute_link($relative_link, $url) | 37 | function 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 | |||
72 | function download_pictures($absolute_path, $fullpath) | 68 | function 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 |