<?php
/**
- * poche, a read it later open source system
+ * wallabag, self hostable application allowing you to not miss any content anymore
*
- * @category poche
- * @author Nicolas Lœuillet <support@inthepoche.com>
+ * @category wallabag
+ * @author Nicolas Lœuillet <nicolas@loeuillet.org>
* @copyright 2013
* @license http://www.wtfpl.net/ see COPYING file
*/
{
$matches = array();
preg_match_all('#<\s*(img)[^>]+src="([^"]*)"[^>]*>#Si', $content, $matches, PREG_SET_ORDER);
- foreach($matches as $i => $link)
- {
+ foreach($matches as $i => $link) {
$link[1] = trim($link[1]);
- if (!preg_match('#^(([a-z]+://)|(\#))#', $link[1]) )
- {
+ if (!preg_match('#^(([a-z]+://)|(\#))#', $link[1])) {
$absolute_path = get_absolute_link($link[2],$url);
$filename = basename(parse_url($absolute_path, PHP_URL_PATH));
$directory = create_assets_directory($id);
/**
* Retourne le lien absolu
*/
-function get_absolute_link($relative_link, $url)
-{
+function get_absolute_link($relative_link, $url) {
/* return if already absolute URL */
if (parse_url($relative_link, PHP_URL_SCHEME) != '') return $relative_link;
/**
* Téléchargement des images
*/
-
function download_pictures($absolute_path, $fullpath)
{
- $rawdata = get_external_file($absolute_path);
+ $rawdata = Tools::getFile($absolute_path);
if(file_exists($fullpath)) {
unlink($fullpath);
{
$assets_path = ABS_PATH;
if(!is_dir($assets_path)) {
- mkdir($assets_path, 0705);
+ mkdir($assets_path, 0715);
}
$article_directory = $assets_path . $id;
if(!is_dir($article_directory)) {
- mkdir($article_directory, 0705);
+ mkdir($article_directory, 0715);
}
return $article_directory;