From acd6e1a6c51928cff55e737c6f1fef2b5b356887 Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Thu, 1 Nov 2007 21:56:44 +0000 Subject: [PATCH] #1500 - Infinite loop in Blog's RSS widget --- code/BlogHolder.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/code/BlogHolder.php b/code/BlogHolder.php index a147e72..7c03bfa 100644 --- a/code/BlogHolder.php +++ b/code/BlogHolder.php @@ -201,6 +201,15 @@ class BlogHolder_Controller extends Page_Controller { return array(); } + function defaultAction($action) { + // Protection against infinite loops when an RSS widget pointing to this page is added to this page + if(stristr($_SERVER['HTTP_USER_AGENT'], 'SimplePie')) { + return $this->rss(); + } + + return parent::defaultAction($action); + } + } @@ -228,4 +237,4 @@ class BlogEntry_Form extends Form { } } -?> \ No newline at end of file +?>