diff options
| author | 2017-10-01 18:31:28 +0200 | |
|---|---|---|
| committer | 2017-10-01 18:31:28 +0200 | |
| commit | ceda55c75b158fc1cf4813fe0f258527754b9289 (patch) | |
| tree | 7c84ac32cc845ab1d70ea5a3fb263c6613de34b0 /lib | |
| parent | cb7ba3e47576aa1d0c3f53e5966f831e6540bbc3 (diff) | |
| parent | f241fc1841df89285ecb6f124f0d70198d712b2f (diff) | |
Merge pull request #1651 from FreshRSS/dev1.8.0
Release 1.8.0
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Minz/ActionController.php | 6 | ||||
| -rw-r--r-- | lib/Minz/ActionException.php | 2 | ||||
| -rw-r--r-- | lib/Minz/Configuration.php | 4 | ||||
| -rw-r--r-- | lib/Minz/ControllerNotActionControllerException.php | 2 | ||||
| -rw-r--r-- | lib/Minz/ControllerNotExistException.php | 2 | ||||
| -rw-r--r-- | lib/Minz/CurrentPagePaginationException.php | 2 | ||||
| -rw-r--r-- | lib/Minz/Dispatcher.php | 2 | ||||
| -rw-r--r-- | lib/Minz/FileNotExistException.php | 2 | ||||
| -rw-r--r-- | lib/Minz/FrontController.php | 4 | ||||
| -rw-r--r-- | lib/Minz/Helper.php | 4 | ||||
| -rw-r--r-- | lib/Minz/Model.php | 2 | ||||
| -rw-r--r-- | lib/Minz/ModelArray.php | 3 | ||||
| -rw-r--r-- | lib/Minz/ModelPdo.php | 2 | ||||
| -rw-r--r-- | lib/Minz/PDOConnectionException.php | 2 | ||||
| -rw-r--r-- | lib/Minz/Paginator.php | 8 | ||||
| -rw-r--r-- | lib/Minz/Translate.php | 4 | ||||
| -rw-r--r-- | lib/Minz/View.php | 2 | ||||
| -rw-r--r-- | lib/favicons.php | 1 | ||||
| -rw-r--r-- | lib/lib_date.php | 5 | ||||
| -rw-r--r-- | lib/lib_install.php | 5 | ||||
| -rw-r--r-- | lib/lib_rss.php | 12 |
21 files changed, 38 insertions, 38 deletions
diff --git a/lib/Minz/ActionController.php b/lib/Minz/ActionController.php index b47c54554..232a4ef9b 100644 --- a/lib/Minz/ActionController.php +++ b/lib/Minz/ActionController.php @@ -1,5 +1,5 @@ <?php -/** +/** * MINZ - Copyright 2011 Marien Fressinaud * Sous licence AGPL3 <http://www.gnu.org/licenses/> */ @@ -24,7 +24,7 @@ class Minz_ActionController { public function view () { return $this->view; } - + /** * Méthodes à redéfinir (ou non) par héritage * firstAction est la première méthode exécutée par le Dispatcher @@ -34,5 +34,3 @@ class Minz_ActionController { public function firstAction () { } public function lastAction () { } } - - diff --git a/lib/Minz/ActionException.php b/lib/Minz/ActionException.php index c566a076f..f1f70c1bc 100644 --- a/lib/Minz/ActionException.php +++ b/lib/Minz/ActionException.php @@ -3,7 +3,7 @@ class Minz_ActionException extends Minz_Exception { public function __construct ($controller_name, $action_name, $code = self::ERROR) { $message = '`' . $action_name . '` cannot be invoked on `' . $controller_name . '`'; - + parent::__construct ($message, $code); } } diff --git a/lib/Minz/Configuration.php b/lib/Minz/Configuration.php index d695d4a53..5470dc85f 100644 --- a/lib/Minz/Configuration.php +++ b/lib/Minz/Configuration.php @@ -104,7 +104,7 @@ class Minz_Configuration { /** * Create a new Minz_Configuration object. - * + * * @param $namespace the name of the current configuration. * @param $config_filename the file containing configuration values. * @param $default_filename the file containing default values, null by default. @@ -145,7 +145,7 @@ class Minz_Configuration { /** * Return the value of the given param. - * + * * @param $key the name of the param. * @param $default default value to return if key does not exist. * @return the value corresponding to the key. diff --git a/lib/Minz/ControllerNotActionControllerException.php b/lib/Minz/ControllerNotActionControllerException.php index 535a1377e..1a8e0729c 100644 --- a/lib/Minz/ControllerNotActionControllerException.php +++ b/lib/Minz/ControllerNotActionControllerException.php @@ -3,7 +3,7 @@ class Minz_ControllerNotActionControllerException extends Minz_Exception { public function __construct ($controller_name, $code = self::ERROR) { $message = 'Controller `' . $controller_name . '` isn\'t instance of ActionController'; - + parent::__construct ($message, $code); } } diff --git a/lib/Minz/ControllerNotExistException.php b/lib/Minz/ControllerNotExistException.php index 523867d11..24a09a635 100644 --- a/lib/Minz/ControllerNotExistException.php +++ b/lib/Minz/ControllerNotExistException.php @@ -3,7 +3,7 @@ class Minz_ControllerNotExistException extends Minz_Exception { public function __construct ($controller_name, $code = self::ERROR) { $message = 'Controller `' . $controller_name . '` doesn\'t exist'; - + parent::__construct ($message, $code); } } diff --git a/lib/Minz/CurrentPagePaginationException.php b/lib/Minz/CurrentPagePaginationException.php index 74214d879..3e3d9d1b4 100644 --- a/lib/Minz/CurrentPagePaginationException.php +++ b/lib/Minz/CurrentPagePaginationException.php @@ -2,7 +2,7 @@ class Minz_CurrentPagePaginationException extends Minz_Exception { public function __construct ($page) { $message = 'Page number `' . $page . '` doesn\'t exist'; - + parent::__construct ($message, self::ERROR); } } diff --git a/lib/Minz/Dispatcher.php b/lib/Minz/Dispatcher.php index 125ce5757..bdb1c76f6 100644 --- a/lib/Minz/Dispatcher.php +++ b/lib/Minz/Dispatcher.php @@ -1,5 +1,5 @@ <?php -/** +/** * MINZ - Copyright 2011 Marien Fressinaud * Sous licence AGPL3 <http://www.gnu.org/licenses/> */ diff --git a/lib/Minz/FileNotExistException.php b/lib/Minz/FileNotExistException.php index f8dfbdf66..f97f161af 100644 --- a/lib/Minz/FileNotExistException.php +++ b/lib/Minz/FileNotExistException.php @@ -2,7 +2,7 @@ class Minz_FileNotExistException extends Minz_Exception { public function __construct ($file_name, $code = self::ERROR) { $message = 'File not found: `' . $file_name.'`'; - + parent::__construct ($message, $code); } } diff --git a/lib/Minz/FrontController.php b/lib/Minz/FrontController.php index 952d983c9..066278b7c 100644 --- a/lib/Minz/FrontController.php +++ b/lib/Minz/FrontController.php @@ -119,12 +119,12 @@ class Minz_FrontController { switch($conf->environment) { case 'production': error_reporting(E_ALL); - ini_set('display_errors','Off'); + ini_set('display_errors', 'Off'); ini_set('log_errors', 'On'); break; case 'development': error_reporting(E_ALL); - ini_set('display_errors','On'); + ini_set('display_errors', 'On'); ini_set('log_errors', 'On'); break; case 'silent': diff --git a/lib/Minz/Helper.php b/lib/Minz/Helper.php index f4a547c4e..c328d9e6b 100644 --- a/lib/Minz/Helper.php +++ b/lib/Minz/Helper.php @@ -1,5 +1,5 @@ <?php -/** +/** * MINZ - Copyright 2011 Marien Fressinaud * Sous licence AGPL3 <http://www.gnu.org/licenses/> */ @@ -13,7 +13,7 @@ class Minz_Helper { * @param $var variable à traiter (tableau ou simple variable) */ public static function stripslashes_r($var) { - if (is_array($var)){ + if (is_array($var)) { return array_map(array('Minz_Helper', 'stripslashes_r'), $var); } else { return stripslashes($var); diff --git a/lib/Minz/Model.php b/lib/Minz/Model.php index adbaba942..1310888cf 100644 --- a/lib/Minz/Model.php +++ b/lib/Minz/Model.php @@ -1,5 +1,5 @@ <?php -/** +/** * MINZ - Copyright 2011 Marien Fressinaud * Sous licence AGPL3 <http://www.gnu.org/licenses/> */ diff --git a/lib/Minz/ModelArray.php b/lib/Minz/ModelArray.php index ff23dbc83..1ac2b313d 100644 --- a/lib/Minz/ModelArray.php +++ b/lib/Minz/ModelArray.php @@ -25,8 +25,7 @@ class Minz_ModelArray { protected function loadArray() { if (!file_exists($this->filename)) { throw new Minz_FileNotExistException($this->filename, Minz_Exception::WARNING); - } - elseif (($handle = $this->getLock()) === false) { + } elseif (($handle = $this->getLock()) === false) { throw new Minz_PermissionDeniedException($this->filename); } else { $data = include($this->filename); diff --git a/lib/Minz/ModelPdo.php b/lib/Minz/ModelPdo.php index caab1d114..d769e0ff4 100644 --- a/lib/Minz/ModelPdo.php +++ b/lib/Minz/ModelPdo.php @@ -39,7 +39,7 @@ class Minz_ModelPdo { if ($currentUser === null) { $currentUser = Minz_Session::param('currentUser'); } - if (self::$useSharedBd && self::$sharedBd != null && + if (self::$useSharedBd && self::$sharedBd != null && ($currentUser == null || $currentUser === self::$sharedCurrentUser)) { $this->bd = self::$sharedBd; $this->prefix = self::$sharedPrefix; diff --git a/lib/Minz/PDOConnectionException.php b/lib/Minz/PDOConnectionException.php index faf2e0fe9..064748708 100644 --- a/lib/Minz/PDOConnectionException.php +++ b/lib/Minz/PDOConnectionException.php @@ -3,7 +3,7 @@ class Minz_PDOConnectionException extends Minz_Exception { public function __construct ($string_connection, $user, $code = self::ERROR) { $message = 'Access to database is denied for `' . $user . '`' . ' (`' . $string_connection . '`)'; - + parent::__construct ($message, $code); } } diff --git a/lib/Minz/Paginator.php b/lib/Minz/Paginator.php index 5858e76a5..795085a30 100644 --- a/lib/Minz/Paginator.php +++ b/lib/Minz/Paginator.php @@ -1,5 +1,5 @@ <?php -/** +/** * MINZ - Copyright 2011 Marien Fressinaud * Sous licence AGPL3 <http://www.gnu.org/licenses/> */ @@ -51,7 +51,7 @@ class Minz_Paginator { */ public function render ($view, $getteur) { $view = APP_PATH . '/views/helpers/'.$view; - + if (file_exists ($view)) { include ($view); } @@ -129,7 +129,7 @@ class Minz_Paginator { $begin = ($this->currentPage - 1) * $this->nbItemsPerPage; $counter = 0; $i = 0; - + foreach ($this->items as $key => $item) { if ($i >= $begin) { $array[$key] = $item; @@ -164,7 +164,7 @@ class Minz_Paginator { if (is_array ($items)) { $this->items = $items; } - + $this->_nbPage (); } public function _nbItemsPerPage ($nbItemsPerPage) { diff --git a/lib/Minz/Translate.php b/lib/Minz/Translate.php index baddcb424..d9cd59f7e 100644 --- a/lib/Minz/Translate.php +++ b/lib/Minz/Translate.php @@ -1,5 +1,5 @@ <?php -/** +/** * MINZ - Copyright 2011 Marien Fressinaud * Sous licence AGPL3 <http://www.gnu.org/licenses/> */ @@ -153,7 +153,7 @@ class Minz_Translate { * @param additional parameters for variable keys. * @return the value corresponding to the key. * If no value is found, return the key itself. - */ + */ public static function t($key) { $group = explode('.', $key); diff --git a/lib/Minz/View.php b/lib/Minz/View.php index 8c5230ab6..d6bf6ea2c 100644 --- a/lib/Minz/View.php +++ b/lib/Minz/View.php @@ -262,5 +262,3 @@ class Minz_View { } } } - - diff --git a/lib/favicons.php b/lib/favicons.php index 48f7c9fda..a7ed966a1 100644 --- a/lib/favicons.php +++ b/lib/favicons.php @@ -16,6 +16,7 @@ function isImgMime($content) { $isImage = strpos(finfo_buffer($fInfo, $content), 'image') !== false; finfo_close($fInfo); } catch (Exception $e) { + echo 'Caught exception: ', $e->getMessage(), "\n"; } return $isImage; } diff --git a/lib/lib_date.php b/lib/lib_date.php index 9533711e3..cb1f1d1e2 100644 --- a/lib/lib_date.php +++ b/lib/lib_date.php @@ -1,6 +1,6 @@ <?php /** - * Author: Alexandre Alapetite http://alexandre.alapetite.fr + * Author: Alexandre Alapetite https://alexandre.alapetite.fr * 2014-06-01 * License: GNU AGPLv3 http://www.gnu.org/licenses/agpl-3.0.html * @@ -63,8 +63,7 @@ function _dateCeiling($isoDate) { } function _noDelimit($isoDate) { - return $isoDate === null || $isoDate === '' ? null : - str_replace(array('-', ':'), '', $isoDate); //FIXME: Bug with negative time zone + return $isoDate === null || $isoDate === '' ? null : str_replace(array('-', ':'), '', $isoDate); //FIXME: Bug with negative time zone } function _dateRelative($d1, $d2) { diff --git a/lib/lib_install.php b/lib/lib_install.php index bf81c15b4..7305d8e28 100644 --- a/lib/lib_install.php +++ b/lib/lib_install.php @@ -6,7 +6,7 @@ Minz_Configuration::register('default_system', join_path(FRESHRSS_PATH, 'config. Minz_Configuration::register('default_user', join_path(FRESHRSS_PATH, 'config-user.default.php')); function checkRequirements($dbType = '') { - $php = version_compare(PHP_VERSION, '5.3.3') >= 0; + $php = version_compare(PHP_VERSION, '5.3.8') >= 0; $minz = file_exists(join_path(LIB_PATH, 'Minz')); $curl = extension_loaded('curl'); $pdo_mysql = extension_loaded('pdo_mysql'); @@ -68,8 +68,7 @@ function checkRequirements($dbType = '') { 'http_referer' => $http_referer ? 'ok' : 'ko', 'message' => $message ?: 'ok', 'all' => $php && $minz && $curl && $pdo && $pcre && $ctype && $dom && $xml && - $data && $cache && $users && $favicons && $http_referer && $message == '' ? - 'ok' : 'ko' + $data && $cache && $users && $favicons && $http_referer && $message == '' ? 'ok' : 'ko' ); } diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 22136854e..09048700d 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -1,4 +1,8 @@ <?php +if (version_compare(PHP_VERSION, '5.3.8', '<')) { + die('FreshRSS error: FreshRSS requires PHP 5.3.8+!'); +} + if (!function_exists('json_decode')) { require_once('JSON.php'); function json_decode($var, $assoc = false) { @@ -187,9 +191,9 @@ function customSimplePie() { 'onmouseover', 'onmousemove', 'onmouseout', 'onfocus', 'onblur', 'onkeypress', 'onkeydown', 'onkeyup', 'onselect', 'onchange', 'seamless', 'sizes', 'srcset'))); $simplePie->add_attributes(array( - 'audio' => array('preload' => 'none'), + 'audio' => array('controls' => 'controls', 'preload' => 'none'), 'iframe' => array('sandbox' => 'allow-scripts allow-same-origin'), - 'video' => array('preload' => 'none'), + 'video' => array('controls' => 'controls', 'preload' => 'none'), )); $simplePie->set_url_replacements(array( 'a' => 'href', @@ -344,6 +348,7 @@ function get_user_configuration($username) { join_path(FRESHRSS_PATH, 'config-user.default.php')); } catch (Minz_ConfigurationNamespaceException $e) { // namespace already exists, do nothing. + Minz_Log::warning($e->getMessage()); } catch (Minz_FileNotExistException $e) { Minz_Log::warning($e->getMessage()); return null; @@ -362,6 +367,7 @@ function cryptAvailable() { $hash = '$2y$04$usesomesillystringfore7hnbRJHxXVLeakoG8K30oukPsA.ztMG'; return $hash === @crypt('password', $hash); } catch (Exception $e) { + Minz_Log::warning($e->getMessage()); } return false; } @@ -393,7 +399,7 @@ function check_install_php() { $pdo_mysql = extension_loaded('pdo_mysql'); $pdo_sqlite = extension_loaded('pdo_sqlite'); return array( - 'php' => version_compare(PHP_VERSION, '5.3.3') >= 0, + 'php' => version_compare(PHP_VERSION, '5.3.8') >= 0, 'minz' => file_exists(LIB_PATH . '/Minz'), 'curl' => extension_loaded('curl'), 'pdo' => $pdo_mysql || $pdo_sqlite, |
