summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--iplayer.php3
1 files changed, 3 insertions, 0 deletions
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 {
?>