Download & Extend

Little patch for query string in swf filename

Project:SWF Tools
Version:6.x-2.5
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:reviewed & tested by the community

Issue Summary

Hello, there is a small bug in the swftools.module, if the filename has a query string, the swftools_get_action function will not return the good action because of the file's extension.

To correct this bug, replace in swftools.module at line 642 :

<?php
function swftools_get_action($file) {
?>

by :

<?php
function swftools_get_action($file) {
 
// If query string, get it's position
 
if (($q = strpos($file, '?')) !== FALSE) {
   
$file = substr($file, 0, $q);
  }
?>

And use the stream variable in othervars when you call swf else the filename will be reset.

Comments

#1

Status:active» needs review

Resubmitting as patch.

The code is basically the same as here:
http://de3.php.net/manual/en/function.pathinfo.php#88654

I have this runnig at my flash game site > 4.000 Users a day so I believe its okay.

Please add this to the module!

AttachmentSize
swftools-582742.patch 741 bytes

#2

Status:needs review» reviewed & tested by the community

I have tested against 6.x-2.5 and 6.x-3.0-beta4

I'd like to see this added too.