CMS Made Simple Forums
https://forum.cmsmadesimple.org/

CMSMS 1.10 Beta3: When MicroTiny doesn't load...
https://forum.cmsmadesimple.org/viewtopic.php?f=74&t=56883
Page 1 of 1

Author:  fredp [ Wed Sep 21, 2011 10:14 am ]
Post subject:  CMSMS 1.10 Beta3: When MicroTiny doesn't load...

Hi,

I tried a new 1.10-beta3 install on a different server with its own SSL cert. This time, however, I had a hard time getting MicroTiny to start-up for content textareas. I just found the "problem" and thought that, while technically it may not be a bug, at the very least, it should be mentioned in the 1.10 release notes. That said... there is a simple code change that would make this a non-issue. More on that after a description of the problem...

It seems that MicroTiny init. code is cached in /tmp/cache in files with names that match this regex: '^mt_[0-9a-z]{32}$'. Such names are a problem if you happen to use a particular mod_rewrite rule taken from doc/htaccess.txt:
Code:
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteCond %{REQUEST_METHOD} !POST$
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
Since these filenames don't contain a dot, the rule fires -- ultimately resulting in failed GET requests. For example:
Code:
GET /tmp/cache/mt_0f3d9d7e1635a606aa639e5d24f0575b?t=1316595595 HTTP/1.1
...
HTTP/1.1 301 Moved Permanently
...
GET /tmp/cache/mt_0f3d9d7e1635a606aa639e5d24f0575b/?t=1316595595 HTTP/1.1
...
HTTP/1.1 404 Not Found
Of course, this would be a non-issue if someone were to change these filenames to include a dot. For example, maybe replace the underscore character with a dot... Just a thought. ;)

There is another issue related to this test case, but I'll create a separate post for it so that it can be tracked separately.

Hope this helps,
Fred P.

Author:  fredp [ Tue Oct 11, 2011 10:08 pm ]
Post subject:  Re: CMSMS 1.10 Beta3: When MicroTiny doesn't load...

Update:
I found a temporary workaround for the case where MicroTiny doesn't load if you have the "301 Redirect all requests that don't contain a dot or trailing slash..." mod_rewrite rule (from doc/htaccess.txt) enabled. It appears to work on CMSMS 1.10-beta4.

I really don't like this kind of workaround, as it depends on MicroTiny's internal file naming conventions--bletch!!! That said, perhaps it might help as a *temporary* solution until a better alternative comes along.

Workaround : add additional RewriteCond line to the aforementioned RewriteRule in .htaccess (below in red):

Quote:
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
# but ignore POST requests.
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
# Workaround--WARNING: Relies on MicroTiny implementation *USE AT YOUR OWN RISK*
RewriteCond %{REQUEST_URI} !/tmp/cache/mt_[0-9a-z]{32}$
RewriteCond %{REQUEST_METHOD} !POST$
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]

Author:  calguy1000 [ Tue Oct 11, 2011 10:47 pm ]
Post subject:  Re: CMSMS 1.10 Beta3: When MicroTiny doesn't load...

Fixed in svn.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/