Proposed change to swftools_get_action function:

This single line is to ignore the trailing GET for $file if there is a GET string in the http request. This use of a GET string appended to the swf name for example is a legacy method for swfs to receive variables...flashvars is the better option to do this now. But the legacy method with the appended GET string could be a requirement for some 3rd party (i.e. external) swfs embedded in the local site.

The way the original code worked failed to recognise the file extension where there was a GET string appended to the URL, meaning that it always defaulted to SWFTOOLS_MEDIA_DISPLAY_LIST

function swftools_get_action($file) {

 //if the $file has trailing GET value(s), ignore them for this check:
  if (strpos($file,"?")!==FALSE) $file=substr($file,0,strpos($file,"?"));
  // Try to determine the action based on the file extension.
  $path_parts = pathinfo($file);
  switch (strtolower($path_parts['extension'])) {
    case 'flv':
      return SWFTOOLS_FLV_DISPLAY;
    case 'swf':
      return SWFTOOLS_SWF_DISPLAY_DIRECT;
    case 'mp3':
      return SWFTOOLS_MP3_DISPLAY;
    case 'jpg': case 'gif': case 'png': case 'jpeg': case 'img':
      return SWFTOOLS_IMAGE_DISPLAY_LIST;
    default:
      // Make a broad assumption that the configured mediaplayer will handle
      // this file or playlist.
      return SWFTOOLS_MEDIA_DISPLAY_LIST;
  }
}

Comments

ron williams’s picture

Status: Needs review » Closed (won't fix)

Since 5.x-1.x is no longer supported, I am marking as closed.