is there a way to ignore certain file types in static sync

84 views
Skip to first unread message

Christopher May

unread,
Mar 24, 2015, 12:48:32 PM3/24/15
to resour...@googlegroups.com
We have a lot of files attached to our projects, such as .html or .js files that I want on our external storage, but I do not want RS to catalog these files through static sync.

I see the nogo folder is there anyway to set up nogo files?

Thanks,

Chris

Allison Stec

unread,
Mar 24, 2015, 12:57:34 PM3/24/15
to ResourceSpace
have you tried adding those extensions to $banned_extensions

Allison Stec
Senior Developer & Asset Management Specialist
Colorhythm
http://www.colorhythm.com

Main Office: +1 415-399-9921
Fax: +1 415-399-9928

as...@colorhythm.com

--
ResourceSpace: Open Source Digital Asset Management
http://www.resourcespace.org
---
You received this message because you are subscribed to the Google Groups "ResourceSpace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to resourcespac...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Christopher May

unread,
Mar 24, 2015, 1:24:57 PM3/24/15
to resour...@googlegroups.com
Allison,

I just tried it, but no joy. Static Sync allowed the banned files to be uploaded.
That might be a security loophole...

Chris

Allison Stec

unread,
Mar 24, 2015, 1:27:35 PM3/24/15
to ResourceSpace
Yeah! kind of a big one if you ask me...

I know one big issue with staticsync is that it uses an outdated method to add the resources. That might be why banned extensions isn't considered...

Allison Stec
Senior Developer & Asset Management Specialist
Colorhythm
http://www.colorhythm.com

Main Office: +1 415-399-9921
Fax: +1 415-399-9928

as...@colorhythm.com

--

Christopher May

unread,
Mar 24, 2015, 2:12:34 PM3/24/15
to resour...@googlegroups.com
It is easy to fix in staticsync.php:

 # -------FILES---------------
 
 
if (($filetype=="file") && (substr($file,0,1)!=".") && (strtolower($file)!="thumbs.db"))
 
{
     $extension
=strtolower($extension);
 
# Check to see if extension is banned, do not add if it is banned
   
if(array_search($extension, $banned_extensions)===false){   //cmay added this line and the appropriate closing bracket on down the page
 
# Already exists?
 
if (!isset($done[$shortpath]))

and you also need to add: $banned_extensions to the global command at the beginning of the ProcessFolder function


Message has been deleted
Message has been deleted

pathways.ge

unread,
Nov 2, 2016, 6:25:01 AM11/2/16
to ResourceSpace
The solution posted by Cmay seems to be implemented in RS.

Montala (?) made a mistake, though
if(array_search($extension, $banned_extensions)){continue;}

This is called non-strict checking. If your unwanted extension happens to be the first in the list, array_search returns int(0), which evaluates to false. Boom, your unwanted file is still slurped in.

It should be
if(array_search($extension, $banned_extensions) !== false){continue;}

Another case for strict programming practice!

Reply all
Reply to author
Forward
0 new messages