Little patch for query string in swf filename

sinasquax - September 20, 2009 - 14:08
Project:SWF Tools
Version:6.x-2.5
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

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.

#1

Kars-T - October 19, 2009 - 16:53
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
 
 

Drupal is a registered trademark of Dries Buytaert.