News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Ampersands in Mod Files

Started by karlbenson, August 16, 2007, 04:31:01 PM

Previous topic - Next topic

karlbenson

I thought I'd better report a phenomenon that was reported with one of my mods and which I was able to reproduce on my server and my localhost [with xammplite]. (both different PHP5 versions)

The filename of the modification was Amazon_ISBN_&_ASIN_Mod.zip

However when I chose to install either through the forum itself or installing it manually


An Error Has Occurred!
Unable to find package file! 

Please check the zip.


As soon as I removed the ampersand from the filename, the install worked.
Some people managed to install the mod, so I believe it only occurs for certain versions.

SleePy

That is because on some setups the ampersand (&) is treated as part of query string setup.
Just like SMF that uses ;, & is the same.

Some people like me that have this setup in our php.ini
arg_separator.input = "&;"

Will have this happen (If I remove & it wouldn't happen).

So it sees & separating the input. Thus causing a $_REQUEST['_ASIN_MOD.zip'] variable to be set empty (but still set).

There isn't anything SMF can do really. The mod package name needs to be fixed. You can fix the package name as long as you don't change your mod's ID that you set it will be fine and update fine for people when they get the new version.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

karlbenson

I've already fixed and renamed my .zip file without the ampersand.
And informed my user that without the ampersand it works.

I didn't have to alter anything inside the actual .zip file itself.

Thanks SleePy. I now know for future reference not to use ampersands in the file name of the mod (and the reason).

(maybe the & shouldn't be a permitted character for the filename, checking when users upload it?)

Advertisement: