Ticket #294 (closed bug: invalid)
Implementation for `localplay_controller.get_url()` is wrong
| Reported by: | manski | Owned by: | vollmerk |
|---|---|---|---|
| Priority: | major | Milestone: | 3.4.x Stable Release |
| Component: | Streaming / Playback | Version: | 3.4.x |
| Keywords: | Cc: |
Description
The implementation of localplay_controller.get_url() (in r1545) is wrong as the variable object_type doesn't exist. A possible fix is the following code snippet:
/**
* get_url
* This returns the URL for the passed object
*/
public function get_url($object) {
// This might not be an object!
if (!is_object($object)) {
// Stupiidly we'll just blindly add it for now
return $object;
}
$url = null;
// This can get a little complicated
if (is_a($object, 'Random')) {
// Do nothing
} else {
$url = $object->get_url(Stream::get_session());
}
return $url;
} // get_url
I'm assuming that the original code was intented to be correct; i.e. when the object is of type Random then nothing (empty string or null?) shall be returned. Otherwise the method should simply return $object->get_url(Stream::get_session()).
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
