From 8905191413f20e7fba1d635a06cf5ec2ff86cbb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 7 Jan 2014 20:21:43 +0100 Subject: [add] import from poche, thank you @tsadiq #388 --- inc/poche/Poche.class.php | 49 +++++++++++++++++++++++++++++++++++++++++++- inc/poche/config.inc.php.new | 2 ++ 2 files changed, 50 insertions(+), 1 deletion(-) (limited to 'inc/poche') diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 76a73be2..e033ad74 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -847,6 +847,52 @@ class Poche Tools::redirect(); } + /** + * import from Poche exported file + * @param string $targetFile the file used for importing + * @return boolean + */ + private function importFromPoche($targetFile) + { + $str_data = file_get_contents($targetFile); + $data = json_decode($str_data,true); + Tools::logm('starting import from Poche'); + + + $sequence = ''; + if (STORAGE == 'postgres') { + $sequence = 'entries_id_seq'; + } + + $count = 0; + foreach ($data as $value) { + + $url = new Url(base64_encode($value['url'])); + $favorite = ($value['is_fav'] == -1); + $archive = ($value['is_read'] == -1); + + # we can add the url + if (!is_null($url) && $url->isCorrect()) { + + $this->action('add', $url, 0, TRUE); + + $count++; + if ($favorite) { + $last_id = $this->store->getLastId($sequence); + $this->action('toggle_fav', $url, $last_id, TRUE); + } + if ($archive) { + $last_id = $this->store->getLastId($sequence); + $this->action('toggle_archive', $url, $last_id, TRUE); + } + } + + } + $this->messages->add('s', _('import from Poche completed. ' . $count . ' new links.')); + Tools::logm('import from Poche completed'); + Tools::redirect(); + } + /** * import datas into your poche * @param string $from name of the service to import : pocket, instapaper or readability @@ -858,7 +904,8 @@ class Poche $providers = array( 'pocket' => 'importFromPocket', 'readability' => 'importFromReadability', - 'instapaper' => 'importFromInstapaper' + 'instapaper' => 'importFromInstapaper', + 'poche' => 'importFromPoche', ); if (! isset($providers[$from])) { diff --git a/inc/poche/config.inc.php.new b/inc/poche/config.inc.php.new index c60d4f80..1c93be07 100755 --- a/inc/poche/config.inc.php.new +++ b/inc/poche/config.inc.php.new @@ -55,7 +55,9 @@ define ('PAGINATION', '10'); define ('POCKET_FILE', '/ril_export.html'); define ('READABILITY_FILE', '/readability'); define ('INSTAPAPER_FILE', '/instapaper-export.html'); +define ('POCHE_FILE', '/poche-export'); define ('IMPORT_POCKET_FILE', ROOT . POCKET_FILE); define ('IMPORT_READABILITY_FILE', ROOT . READABILITY_FILE); define ('IMPORT_INSTAPAPER_FILE', ROOT . INSTAPAPER_FILE); +define ('IMPORT_POCHE_FILE', ROOT . POCHE_FILE); \ No newline at end of file -- cgit v1.2.3 From f878daeb8bc9245a294677e4ac141f8bd37c2b4f Mon Sep 17 00:00:00 2001 From: adev Date: Sun, 12 Jan 2014 17:08:52 +0100 Subject: add basic auth in file_get_contents for content extraction when user use basic auth --- inc/poche/Poche.class.php | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'inc/poche') diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index e033ad74..004cca8e 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -325,6 +325,22 @@ class Poche ); } + protected function getPageContent(Url $url) + { + $options = array('http' => array('user_agent' => 'poche')); + if (isset($_SERVER['AUTH_TYPE']) && "basic" === strtolower($_SERVER['AUTH_TYPE'])) { + $options['http']['header'] = sprintf( + "Authorization: Basic %s", + base64_encode( + sprintf('%s:%s', $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) + ) + ); + } + $context = stream_context_create($options); + $json = file_get_contents(Tools::getPocheUrl() . '/inc/3rdparty/makefulltextfeed.php?url='.urlencode($url->getUrl()).'&max=5&links=preserve&exc=&format=json&submit=Create+Feed', false, $context); + return json_decode($json, true); + } + /** * Call action (mark as fav, archive, delete, etc.) */ @@ -333,10 +349,7 @@ class Poche switch ($action) { case 'add': - $options = array('http' => array('user_agent' => 'poche')); - $context = stream_context_create($options); - $json = file_get_contents(Tools::getPocheUrl() . '/inc/3rdparty/makefulltextfeed.php?url='.urlencode($url->getUrl()).'&max=5&links=preserve&exc=&format=json&submit=Create+Feed', false, $context); - $content = json_decode($json, true); + $content = $this->getPageContent($url); $title = $content['rss']['channel']['item']['title']; $body = $content['rss']['channel']['item']['description']; -- cgit v1.2.3 From d1d3498b62d00a88968378a3244ffd479a852b2e Mon Sep 17 00:00:00 2001 From: Lonnytunes Date: Mon, 20 Jan 2014 00:44:51 +0100 Subject: [fix] Stops multiplication, in database, of a same user config item (error of variable name). --- inc/poche/Database.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/poche') diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 04731821..48ec5abf 100644 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php @@ -193,7 +193,7 @@ class Database { public function updateUserConfig($userId, $key, $value) { $config = $this->getConfigUser($userId); - if (!isset ($user_config[$key])) { + if (! isset($config[$key])) { $sql = "INSERT INTO users_config (value, user_id, name) VALUES (?, ?, ?)"; } else { -- cgit v1.2.3 From c95b78a8ceb918f033f3dd6c26aa7da4a8a527dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 28 Jan 2014 10:36:04 +0100 Subject: poche is dead, welcome wallabag --- inc/poche/Database.class.php | 6 +++--- inc/poche/Poche.class.php | 9 +++++---- inc/poche/Tools.class.php | 6 +++--- inc/poche/Url.class.php | 6 +++--- inc/poche/User.class.php | 6 +++--- inc/poche/config.inc.php.new | 6 +++--- inc/poche/global.inc.php | 6 +++--- inc/poche/pochePictures.php | 6 +++--- 8 files changed, 26 insertions(+), 25 deletions(-) (limited to 'inc/poche') diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 48ec5abf..3b0f455e 100644 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php @@ -1,9 +1,9 @@ + * @category wallabag + * @author Nicolas Lœuillet * @copyright 2013 * @license http://www.wtfpl.net/ see COPYING file */ diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index e033ad74..4a5a954b 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -1,9 +1,9 @@ + * @category wallabag + * @author Nicolas Lœuillet * @copyright 2013 * @license http://www.wtfpl.net/ see COPYING file */ @@ -29,7 +29,8 @@ class Poche 'dark' => array('requires' => array('default')), 'dmagenta' => array('requires' => array('default')), 'solarized' => array('requires' => array('default')), - 'solarized-dark' => array('requires' => array('default')) + 'solarized-dark' => array('requires' => array('default')), + 'courgette' => array('requires' => array()) ); public function __construct() diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 63916582..248a44d7 100644 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php @@ -1,9 +1,9 @@ + * @category wallabag + * @author Nicolas Lœuillet * @copyright 2013 * @license http://www.wtfpl.net/ see COPYING file */ diff --git a/inc/poche/Url.class.php b/inc/poche/Url.class.php index 8b3468c3..aba236fa 100644 --- a/inc/poche/Url.class.php +++ b/inc/poche/Url.class.php @@ -1,9 +1,9 @@ + * @category wallabag + * @author Nicolas Lœuillet * @copyright 2013 * @license http://www.wtfpl.net/ see COPYING file */ diff --git a/inc/poche/User.class.php b/inc/poche/User.class.php index 6dac7839..cc8bec65 100644 --- a/inc/poche/User.class.php +++ b/inc/poche/User.class.php @@ -1,9 +1,9 @@ + * @category wallabag + * @author Nicolas Lœuillet * @copyright 2013 * @license http://www.wtfpl.net/ see COPYING file */ diff --git a/inc/poche/config.inc.php.new b/inc/poche/config.inc.php.new index 1c93be07..39cb2f2f 100755 --- a/inc/poche/config.inc.php.new +++ b/inc/poche/config.inc.php.new @@ -1,9 +1,9 @@ + * @category wallabag + * @author Nicolas Lœuillet * @copyright 2013 * @license http://www.wtfpl.net/ see COPYING file */ diff --git a/inc/poche/global.inc.php b/inc/poche/global.inc.php index 846699d3..e2beade1 100644 --- a/inc/poche/global.inc.php +++ b/inc/poche/global.inc.php @@ -1,9 +1,9 @@ + * @category wallabag + * @author Nicolas Lœuillet * @copyright 2013 * @license http://www.wtfpl.net/ see COPYING file */ diff --git a/inc/poche/pochePictures.php b/inc/poche/pochePictures.php index b0cfb9df..e4b0b160 100644 --- a/inc/poche/pochePictures.php +++ b/inc/poche/pochePictures.php @@ -1,9 +1,9 @@ + * @category wallabag + * @author Nicolas Lœuillet * @copyright 2013 * @license http://www.wtfpl.net/ see COPYING file */ -- cgit v1.2.3 From 3e0e7e1208e8d3ee3b23df42ea119d7c50b0db5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 28 Jan 2014 10:49:57 +0100 Subject: [fix] inthepoche.com => wallabag.org --- inc/poche/Poche.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc/poche') diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 4a5a954b..d4733218 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -111,7 +111,7 @@ class Poche $passTheme = TRUE; # Twig is an absolute requirement for Poche to function. Abort immediately if the Composer installer hasn't been run yet if (! self::$canRenderTemplates) { - $this->notInstalledMessage[] = 'Twig does not seem to be installed. Please initialize the Composer installation to automatically fetch dependencies. Have a look at the documentation.'; + $this->notInstalledMessage[] = 'Twig does not seem to be installed. Please initialize the Composer installation to automatically fetch dependencies. Have a look at the documentation.'; $passTheme = FALSE; } @@ -956,7 +956,7 @@ class Poche if (file_exists($cache_file) && (filemtime($cache_file) > (time() - 86400 ))) { $version = file_get_contents($cache_file); } else { - $version = file_get_contents('http://static.inthepoche.com/versions/' . $which); + $version = file_get_contents('http://static.wallabag.org/versions/' . $which); file_put_contents($cache_file, $version, LOCK_EX); } return $version; -- cgit v1.2.3 From f4fbfaa7cbaaf07aae7d8f0533d293fa4dc605cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 28 Jan 2014 11:19:06 +0100 Subject: some fix to courgette theme --- inc/poche/Poche.class.php | 114 ++++++++++++++++++++++++++++------------------ 1 file changed, 69 insertions(+), 45 deletions(-) (limited to 'inc/poche') diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 0be1668d..e9b14121 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -22,16 +22,6 @@ class Poche private $currentTheme = ''; private $currentLanguage = ''; private $notInstalledMessage = array(); - - # @todo make this dynamic (actually install themes and save them in the database including author information et cetera) - private $installedThemes = array( - 'default' => array('requires' => array()), - 'dark' => array('requires' => array('default')), - 'dmagenta' => array('requires' => array('default')), - 'solarized' => array('requires' => array('default')), - 'solarized-dark' => array('requires' => array('default')), - 'courgette' => array('requires' => array()) - ); public function __construct() { @@ -124,21 +114,26 @@ class Poche } # Check if the selected theme and its requirements are present - if ($this->getTheme() != '' && ! is_dir(THEME . '/' . $this->getTheme())) { - $this->notInstalledMessage[] = 'The currently selected theme (' . $this->getTheme() . ') does not seem to be properly installed (Missing directory: ' . THEME . '/' . $this->getTheme() . ')'; + $theme = $this->getTheme(); + + if ($theme != '' && ! is_dir(THEME . '/' . $theme)) { + $this->notInstalledMessage[] = 'The currently selected theme (' . $theme . ') does not seem to be properly installed (Missing directory: ' . THEME . '/' . $theme . ')'; self::$canRenderTemplates = false; $passTheme = FALSE; } - foreach ($this->installedThemes[$this->getTheme()]['requires'] as $requiredTheme) { - if (! is_dir(THEME . '/' . $requiredTheme)) { - $this->notInstalledMessage[] = 'The required "' . $requiredTheme . '" theme is missing for the current theme (' . $this->getTheme() . ')'; + $themeInfo = $this->getThemeInfo($theme); + if (isset($themeInfo['requirements']) && is_array($themeInfo['requirements'])) { + foreach ($themeInfo['requirements'] as $requiredTheme) { + if (! is_dir(THEME . '/' . $requiredTheme)) { + $this->notInstalledMessage[] = 'The required "' . $requiredTheme . '" theme is missing for the current theme (' . $theme . ')'; - self::$canRenderTemplates = false; + self::$canRenderTemplates = false; - $passTheme = FALSE; + $passTheme = FALSE; + } } } @@ -194,32 +189,36 @@ class Poche private function initTpl() { $loaderChain = new Twig_Loader_Chain(); + $theme = $this->getTheme(); # add the current theme as first to the loader chain so Twig will look there first for overridden template files try { - $loaderChain->addLoader(new Twig_Loader_Filesystem(THEME . '/' . $this->getTheme())); + $loaderChain->addLoader(new Twig_Loader_Filesystem(THEME . '/' . $theme)); } catch (Twig_Error_Loader $e) { # @todo isInstalled() should catch this, inject Twig later - die('The currently selected theme (' . $this->getTheme() . ') does not seem to be properly installed (' . THEME . '/' . $this->getTheme() .' is missing)'); + die('The currently selected theme (' . $theme . ') does not seem to be properly installed (' . THEME . '/' . $theme .' is missing)'); } # add all required themes to the loader chain - foreach ($this->installedThemes[$this->getTheme()]['requires'] as $requiredTheme) { - try { - $loaderChain->addLoader(new Twig_Loader_Filesystem(THEME . '/' . DEFAULT_THEME)); - } catch (Twig_Error_Loader $e) { - # @todo isInstalled() should catch this, inject Twig later - die('The required "' . $requiredTheme . '" theme is missing for the current theme (' . $this->getTheme() . ')'); + $themeInfo = $this->getThemeInfo($theme); + if (isset($themeInfo['requirements']) && is_array($themeInfo['requirements'])) { + foreach ($themeInfo['requirements'] as $requiredTheme) { + try { + $loaderChain->addLoader(new Twig_Loader_Filesystem(THEME . '/' . $requiredTheme)); + } catch (Twig_Error_Loader $e) { + # @todo isInstalled() should catch this, inject Twig later + die('The required "' . $requiredTheme . '" theme is missing for the current theme (' . $theme . ')'); + } } } if (DEBUG_POCHE) { - $twig_params = array(); + $twigParams = array(); } else { - $twig_params = array('cache' => CACHE); + $twigParams = array('cache' => CACHE); } - $this->tpl = new Twig_Environment($loaderChain, $twig_params); + $this->tpl = new Twig_Environment($loaderChain, $twigParams); $this->tpl->addExtension(new Twig_Extensions_Extension_I18n()); # filter to display domain name of an url @@ -235,7 +234,7 @@ class Poche $this->tpl->addFilter($filter); } - private function install() + private function install() { Tools::logm('poche still not installed'); echo $this->tpl->render('install.twig', array( @@ -266,34 +265,59 @@ class Poche return $this->currentTheme; } - public function getLanguage() { - return $this->currentLanguage; + /** + * Provides theme information by parsing theme.ini file if present in the theme's root directory. + * In all cases, the following data will be returned: + * - name: theme's name, or key if the theme is unnamed, + * - current: boolean informing if the theme is the current user theme. + * + * @param string $theme Theme key (directory name) + * @return array|boolean Theme information, or false if the theme doesn't exist. + */ + public function getThemeInfo($theme) { + if (!is_dir(THEME . '/' . $theme)) { + return false; + } + + $themeIniFile = THEME . '/' . $theme . '/theme.ini'; + $themeInfo = array(); + + if (is_file($themeIniFile) && is_readable($themeIniFile)) { + $themeInfo = parse_ini_file($themeIniFile); + } + + if ($themeInfo === false) { + $themeInfo = array(); + } + if (!isset($themeInfo['name'])) { + $themeInfo['name'] = $theme; + } + $themeInfo['current'] = ($theme === $this->getTheme()); + + return $themeInfo; } public function getInstalledThemes() { $handle = opendir(THEME); $themes = array(); - + while (($theme = readdir($handle)) !== false) { # Themes are stored in a directory, so all directory names are themes # @todo move theme installation data to database - if (! is_dir(THEME . '/' . $theme) || in_array($theme, array('..', '.'))) { + if (!is_dir(THEME . '/' . $theme) || in_array($theme, array('.', '..'))) { continue; } - - $current = false; - - if ($theme === $this->getTheme()) { - $current = true; - } - - $themes[] = array('name' => $theme, 'current' => $current); + + $themes[$theme] = $this->getThemeInfo($theme); } - - sort($themes); + return $themes; } + public function getLanguage() { + return $this->currentLanguage; + } + public function getInstalledLanguages() { $handle = opendir(LOCALE); $languages = array(); @@ -600,8 +624,8 @@ class Poche $themes = $this->getInstalledThemes(); $actualTheme = false; - foreach ($themes as $theme) { - if ($theme['name'] == $_POST['theme']) { + foreach (array_keys($themes) as $theme) { + if ($theme == $_POST['theme']) { $actualTheme = true; break; } -- cgit v1.2.3 From 6af66b1106e67a8dc467a70e8e57d7963b09936b Mon Sep 17 00:00:00 2001 From: Maryana Rozhankivska Date: Thu, 30 Jan 2014 16:35:31 +0200 Subject: fix of bug #368 Endless redirects or user doesn't exist with basic authentication --- inc/poche/Database.class.php | 11 ++++++++--- inc/poche/Poche.class.php | 19 ++++++++++--------- 2 files changed, 18 insertions(+), 12 deletions(-) (limited to 'inc/poche') diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 3b0f455e..0457af69 100644 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php @@ -165,9 +165,14 @@ class Database { } } - public function login($username, $password) { - $sql = "SELECT * FROM users WHERE username=? AND password=?"; - $query = $this->executeQuery($sql, array($username, $password)); + public function login($username, $password, $isauthenticated=false) { + if ($isauthenticated) { + $sql = "SELECT * FROM users WHERE username=?"; + $query = $this->executeQuery($sql, array($username)); + } else { + $sql = "SELECT * FROM users WHERE username=? AND password=?"; + $query = $this->executeQuery($sql, array($username, $password)); + } $login = $query->fetchAll(); $user = array(); diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index e9b14121..77361ef7 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -692,17 +692,17 @@ class Poche */ private function credentials() { if(isset($_SERVER['PHP_AUTH_USER'])) { - return array($_SERVER['PHP_AUTH_USER'],'php_auth'); + return array($_SERVER['PHP_AUTH_USER'],'php_auth',true); } if(!empty($_POST['login']) && !empty($_POST['password'])) { - return array($_POST['login'],$_POST['password']); + return array($_POST['login'],$_POST['password'],false); } if(isset($_SERVER['REMOTE_USER'])) { - return array($_SERVER['REMOTE_USER'],'http_auth'); + return array($_SERVER['REMOTE_USER'],'http_auth',true); } - return array(false,false); - } + return array(false,false,false); + } /** * checks if login & password are correct and save the user in session. @@ -713,18 +713,19 @@ class Poche */ public function login($referer) { - list($login,$password)=$this->credentials(); + list($login,$password,$isauthenticated)=$this->credentials(); if($login === false || $password === false) { $this->messages->add('e', _('login failed: you have to fill all fields')); Tools::logm('login failed'); Tools::redirect(); } if (!empty($login) && !empty($password)) { - $user = $this->store->login($login, Tools::encodeString($password . $login)); + $user = $this->store->login($login, Tools::encodeString($password . $login), $isauthenticated); if ($user != array()) { # Save login into Session - $longlastingsession = isset($_POST['longlastingsession']); - Session::login($user['username'], $user['password'], $login, Tools::encodeString($password . $login), $longlastingsession, array('poche_user' => new User($user))); + $longlastingsession = isset($_POST['longlastingsession']); + $passwordTest = ($isauthenticated) ? $user['password'] : Tools::encodeString($password . $login); + Session::login($user['username'], $user['password'], $login, $passwordTest, $longlastingsession, array('poche_user' => new User($user))); $this->messages->add('s', _('welcome to your poche')); Tools::logm('login successful'); Tools::redirect($referer); -- cgit v1.2.3 From 445a1a1c8de78bf7bba3404aa675e6a57ceefbfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 3 Feb 2014 12:46:09 +0100 Subject: [fix] Add support for X-Forwarded-Proto header field #413 --- inc/poche/Tools.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'inc/poche') diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 248a44d7..515a08aa 100644 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php @@ -43,7 +43,9 @@ class Tools || (isset($_SERVER["SERVER_PORT"]) && $_SERVER["SERVER_PORT"] == '443') // HTTPS detection. || (isset($_SERVER["SERVER_PORT"]) //Custom HTTPS port detection - && $_SERVER["SERVER_PORT"] == SSL_PORT); + && $_SERVER["SERVER_PORT"] == SSL_PORT) + || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) + && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'); $serverport = (!isset($_SERVER["SERVER_PORT"]) || $_SERVER["SERVER_PORT"] == '80' -- cgit v1.2.3 From fa0bfb775a53a074e0a9d642298685b5ed1af83f Mon Sep 17 00:00:00 2001 From: nicosomb Date: Mon, 3 Feb 2014 17:11:00 +0100 Subject: [fix] #389 Empty article title (blank title tag) --- inc/poche/Poche.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/poche') diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 77361ef7..4df90067 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -375,7 +375,7 @@ class Poche { case 'add': $content = $this->getPageContent($url); - $title = $content['rss']['channel']['item']['title']; + $title = ($content['rss']['channel']['item']['title'] != '') ? $content['rss']['channel']['item']['title'] : _('Untitled'); $body = $content['rss']['channel']['item']['description']; if ($this->store->add($url->getUrl(), $title, $body, $this->user->getId())) { -- cgit v1.2.3