diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index e71e268dd..0e0f0fd2d 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -891,7 +891,6 @@ class ApiController extends Zend_Controller_Action * out a message to pypo that a potential change has been made. */ public function rabbitmqDoPushAction() { - $request = $this->getRequest(); Logging::info("Notifying RabbitMQ to send message to pypo"); Application_Model_RabbitMq::PushSchedule(); diff --git a/airtime_mvc/application/models/User.php b/airtime_mvc/application/models/User.php index e8b99acb5..524a8df19 100644 --- a/airtime_mvc/application/models/User.php +++ b/airtime_mvc/application/models/User.php @@ -40,7 +40,7 @@ class Application_Model_User ->filterByDbHost($userId)->count() > 0; } - public function isHost($showId) + public function isHost() { return $this->isUserType(UTYPE_HOST); } diff --git a/airtime_mvc/application/models/Webstream.php b/airtime_mvc/application/models/Webstream.php index 1db3d6124..96dee8f99 100644 --- a/airtime_mvc/application/models/Webstream.php +++ b/airtime_mvc/application/models/Webstream.php @@ -111,10 +111,30 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable $di = null; $length = $parameters["length"]; - $result = preg_match("/^([0-9]{1,2})h ([0-5]?[0-9])m$/", $length, $matches); - if ($result == 1 && count($matches) == 3) { + $result = preg_match("/^(?:([0-9]{1,2})h)?\s*(?:([0-6]?[0-9])m)?$/", $length, $matches); + + $invalid_date_interval = false; + if ($result == 1 && count($matches) == 2) { + $hours = $matches[1]; + $minutes = 0; + } else if ($result == 1 && count($matches) == 3) { $hours = $matches[1]; $minutes = $matches[2]; + } else { + $invalid_date_interval = true; + } + + + + if (!$invalid_date_interval) { + + if (!is_numeric($hours)) { + $hours = 0; + } + if (!is_numeric($minutes)) { + $minutes = 0; + } + $di = new DateInterval("PT{$hours}H{$minutes}M"); $totalMinutes = $di->h * 60 + $di->i;