filename filtering for media files
No more spaces in filenames. The only allowed chars are a-z, A-Z, 0-9 and "-_.()". An exception are texture filenames, which may also have a prefix command like "<decal>" included. Also fixed some memory leaks in media download.
This commit is contained in:
@@ -111,15 +111,19 @@ const char *mmshortname(const char *name) { return !strncmp(name, mmpath, strlen
|
||||
|
||||
void mapmodel(int *rad, int *h, int *zoff, char *snap, char *name)
|
||||
{
|
||||
intret(mapmodels.length());
|
||||
mapmodelinfo &mmi = mapmodels.add();
|
||||
mmi.rad = *rad;
|
||||
mmi.h = *h;
|
||||
mmi.zoff = *zoff;
|
||||
mmi.m = NULL;
|
||||
formatstring(mmi.name)("%s%s", mmpath, name);
|
||||
mapmodelchanged = 1;
|
||||
flagmapconfigchange();
|
||||
if(*snap && *name) // ignore "mapmodel" commands with insufficient parameters
|
||||
{
|
||||
intret(mapmodels.length());
|
||||
mapmodelinfo &mmi = mapmodels.add();
|
||||
mmi.rad = *rad;
|
||||
mmi.h = *h;
|
||||
mmi.zoff = *zoff;
|
||||
mmi.m = NULL;
|
||||
filtertext(name, name, FTXT__MEDIAFILEPATH);
|
||||
formatstring(mmi.name)("%s%s", mmpath, name);
|
||||
mapmodelchanged = 1;
|
||||
flagmapconfigchange();
|
||||
}
|
||||
}
|
||||
COMMAND(mapmodel, "iiiss");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user