From 283b0aa8b3000c216e87c4efab2add18fb23b8fa Mon Sep 17 00:00:00 2001 From: Luke Edwards Date: Fri, 2 Aug 2013 12:59:44 +1200 Subject: [PATCH] Revert "Merge pull request #3 from howardgrigg/small-fixes" This reverts commit ee6ae7b437837a2f1dbb3beea4516b254c319157, reversing changes made to 32e93d2128fa638d377873e8a03a84104b2092c2. --- code/dataobjects/PodcastEpisode.php | 14 ++++++++------ code/pagetypes/PodcastPage.php | 12 ++---------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/code/dataobjects/PodcastEpisode.php b/code/dataobjects/PodcastEpisode.php index cb58e90..3eb31ec 100644 --- a/code/dataobjects/PodcastEpisode.php +++ b/code/dataobjects/PodcastEpisode.php @@ -116,11 +116,12 @@ public function getMime() { ,'avi' => 'video/x-msvideo' ,'3gp' => 'video/3gpp' ); - $path_parts = pathinfo($filename); - - return $mime_types[$path_parts['extension']]; - } + $extension = strtolower(end(explode('.', $filename))); + + return $mime_types[$extension]; + } + /** * Returns the type for page template for audio, video tags or download link * @return string @@ -141,8 +142,9 @@ public function getType() { ,'avi' => 'video' ,'3gp' => 'video' ); - $path_parts = pathinfo($filename); - return $mime_types[$path_parts['extension']]; + $extension = strtolower(end(explode('.', $filename))); + + return $mime_types[$extension]; } } \ No newline at end of file diff --git a/code/pagetypes/PodcastPage.php b/code/pagetypes/PodcastPage.php index cea888e..3138301 100644 --- a/code/pagetypes/PodcastPage.php +++ b/code/pagetypes/PodcastPage.php @@ -208,12 +208,7 @@ public function rss() { * @return SS_List */ public function podcastEpisodes() { - return PodcastEpisode::get() - ->filter(array( - 'BlockEpisode' => '0', - 'PodcastPageID' => $this->ID - )) - ->sort('EpisodeDate', 'DESC'); + return PodcastEpisode::get()->sort('EpisodeDate', 'DESC'); } @@ -224,10 +219,7 @@ public function podcastEpisodes() { public function paginatedPodcastEpisodes() { $paginatedList = new PaginatedList( PodcastEpisode::get() - ->filter(array( - 'BlockEpisode' => '0', - 'PodcastPageID' => $this->ID - )) + ->filter(array('BlockEpisode' => '0')) ->sort('EpisodeDate', 'DESC') , $this->request );