diff options
| author | 2016-08-13 15:42:53 +0200 | |
|---|---|---|
| committer | 2016-08-13 15:42:53 +0200 | |
| commit | 97efdcac1e38c568b6be313120694e7201d4c69c (patch) | |
| tree | df2bc58e3dc5681049b5da96b44f406e5df94fa8 | |
| parent | 40f1873de790b28890d65263ec1f8426121ae951 (diff) | |
| parent | 02d1d66235d9ca5dd71929c76a1ecec94cf14f3d (diff) | |
Merge pull request #1209 from Alkarex/php5.3-closure
PHP 5.3 compatibility for callback
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rwxr-xr-x | app/Controllers/indexController.php | 14 | ||||
| -rw-r--r-- | app/layout/layout.phtml | 2 |
3 files changed, 9 insertions, 8 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 017bd6e1a..91bc0e525 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * Compatibility * Require at least MySQL 5.5.3+ [#1153](https://github.com/FreshRSS/FreshRSS/issues/1153) * Require at least PHP 5.3.3+ [#1183](https://github.com/FreshRSS/FreshRSS/pull/1183) + * Restore compatibility with PHP 5.3.3 [#1208](https://github.com/FreshRSS/FreshRSS/issues/1208) * Restore compatibility with Microsoft Internet Explorer 11 / Edge [#772](https://github.com/FreshRSS/FreshRSS/issues/772) * Features * Support for full Unicode such as emoji 💕 in MySQL with utf8mb4 [#1153](https://github.com/FreshRSS/FreshRSS/issues/1153) diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php index 7e626720e..2332d225d 100755 --- a/app/Controllers/indexController.php +++ b/app/Controllers/indexController.php @@ -32,9 +32,9 @@ class FreshRSS_index_Controller extends Minz_ActionController { Minz_Error::error(404); } - $this->view->callbackBeforeContent = function() { + $this->view->callbackBeforeContent = function($view) { try { - $entries = $this->listEntriesByContext(); + $entries = FreshRSS_index_Controller::listEntriesByContext(); $nb_entries = count($entries); if ($nb_entries > FreshRSS_Context::$number) { @@ -55,15 +55,15 @@ class FreshRSS_index_Controller extends Minz_ActionController { } } - $this->view->entries = $entries; + $view->entries = $entries; } catch (FreshRSS_EntriesGetter_Exception $e) { Minz_Log::notice($e->getMessage()); Minz_Error::error(404); } - $this->view->categories = FreshRSS_Context::$categories; + $view->categories = FreshRSS_Context::$categories; - $this->view->rss_title = FreshRSS_Context::$name . ' | ' . Minz_View::title(); + $view->rss_title = FreshRSS_Context::$name . ' | ' . Minz_View::title(); $title = FreshRSS_Context::$name; if (FreshRSS_Context::$get_unread > 0) { $title = '(' . FreshRSS_Context::$get_unread . ') ' . $title; @@ -132,7 +132,7 @@ class FreshRSS_index_Controller extends Minz_ActionController { } try { - $this->view->entries = $this->listEntriesByContext(); + $this->view->entries = FreshRSS_index_Controller::listEntriesByContext(); } catch (FreshRSS_EntriesGetter_Exception $e) { Minz_Log::notice($e->getMessage()); Minz_Error::error(404); @@ -189,7 +189,7 @@ class FreshRSS_index_Controller extends Minz_ActionController { /** * This method returns a list of entries based on the Context object. */ - private function listEntriesByContext() { + public static function listEntriesByContext() { $entryDAO = FreshRSS_Factory::createEntryDao(); $get = FreshRSS_Context::currentGet(true); diff --git a/app/layout/layout.phtml b/app/layout/layout.phtml index 7fdc01241..2aeba40a9 100644 --- a/app/layout/layout.phtml +++ b/app/layout/layout.phtml @@ -23,7 +23,7 @@ <?php flush(); if (isset($this->callbackBeforeContent)) { - call_user_func($this->callbackBeforeContent); + call_user_func($this->callbackBeforeContent, $this); } ?> <?php echo self::headTitle(); ?> |
