From 218f98eb531fe0a23ef211050de913d3febf90ba Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Wed, 30 Sep 2015 15:08:02 +0100 Subject: Cater for URLs with no trailing slash where the programme ID is the last component --- iplayer.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iplayer.php b/iplayer.php index e97cc2a..5234fd4 100644 --- a/iplayer.php +++ b/iplayer.php @@ -7,6 +7,9 @@ if (isset($_GET['id'])) { } else if (isset($_POST['url'])) { $idpos = strpos($_POST['url'], "/episode/") + 9; $idlen = strpos($_POST['url'], "/", $idpos) - $idpos; + if ($idlen < 1) { + $idlen = strlen($_POST['url']) - $idpos; + } $id = substr($_POST['url'], $idpos, $idlen); } else { ?> -- cgit v1.2.3