File Folder looping or something (bug?)

I think there is a bug of sorts possibly related to the ClientConfig or just the MODx file browser itself when you crate a folder with a placeholder name.

A little background. I used ClientConfig to set a system wide variable called [[++holidaytheme]] to swap out page banners, css files, and whatever else automatically during a holiday like Christmas. It seems to work good wherever that variable shows up.

If you type a file images/banner-[[++holidaytheme]].jpg it will swap out the name for everyday or christmas or whatever. If you put that in place of the folder name it will swap out the whole folder.

So, I decided instead of manually typing [[++holidaytheme]] for every URL I could create a folder called [[++holidaytheme]] alongside the actual folders and have the browser build the URL automatically. That part works also.

The problem shows up in the file browser. Everywhere there is a [[++holidaytheme]] folder in the file system, the MODx browser will infinitely loop.

image

The folders do not loop in the actual file system, just in the MODx file browser. If I FTP to the location there is only one set of folders. If I view them in MODx it will just keep expanding forever with a new set of folders each time.

Any ideas what causing the looping?

Could be the same issue as in this thread, because the folder name also contains a “+”.

A call to .../connectors/index.php?action=browser/directory/getList&id=[[++holidaytheme]]/&type=dir probably results in an id-value of / (=root-directory) which explains the loop.

It seems that for security reasons on every request the function sanitizeRequest() is called, that strips MODX-Tags [[...]] from all the $_GET-Parameters.

This means that the parameter &id=[[++holidaytheme]]/ becomes &id=/ and the processors returns all the information from the root directory of the media source.