PurpleEdge Posted August 6, 2011 Share Posted August 6, 2011 I and getting a syntax error when trying to upload files from within the TinyMCE HTML editor. The error is... "SyntaxError: missing ; before statement" Does anyone know of a solution to this? I have tried with the latest versions of FF and IE, I am using PS 1.4.3 Link to comment Share on other sites More sharing options...
PurpleEdge Posted August 8, 2011 Author Share Posted August 8, 2011 This appears to be a mod_security issue with TinyMCE and its ajax file manager. My hosts were able to comment out some of the config settings and this seems to have resolved the problem, although I am uncomfortable that mod_security needed to be changed! Link to comment Share on other sites More sharing options...
codegrunt Posted October 6, 2011 Share Posted October 6, 2011 Just encountered this myself with a client. Unfortunately the ajax file manager relies on "../" in file paths passed via GET requests and this triggers mod_security's path traversal checks. Still looking to see if the there is a config option than can be used to get around this limitation (disabling mod_security is NOT a viable solution). [EDIT] After digging a bit I see this is caused by a the ajax file manager wanting a relative path in [admin dir]/ajaxfilemanager/inc/config.base.php line 51: //check if folder exist if (!is_dir('../../some/dir')) mkdir('../../some/dir'); define('CONFIG_SYS_DEFAULT_PATH', '../../some/dir'); //accept relative path only define('CONFIG_SYS_ROOT_PATH', '../../some/dir'); //accept relative path only Unfortunately the way these values are used looks like it will be a significant hack to correct this behaviour. Cheers Link to comment Share on other sites More sharing options...
eugenata Posted February 9, 2012 Share Posted February 9, 2012 new about this problem? Link to comment Share on other sites More sharing options...
eugenata Posted February 13, 2012 Share Posted February 13, 2012 It is not a solution but allows to upload my files. (see attachment) I've found the script online and have integrated in ajaxfilemanager.php, also with its stylesheet. Download attachment for PS. 1.4.6.2: 1) only the script for uploding files (insert anywere you want in your ajafilemanager.php original or in anywere you want appears) 2) ajaxfilemanager complete hack (like you see in image - no need to do anything, just edit italian language) sorry for my english ajaxfilemanager.php upload-files.php Link to comment Share on other sites More sharing options...
eugenata Posted May 21, 2012 Share Posted May 21, 2012 Another possible solution is the direct editing of files /admin/ajaxfilemanager/inc/config.base.php. Find the comment (near line 51): //check if folder exist and replace the code that follows, that is:: //check if folder exist define('CONFIG_SYS_MY_DOCROOT', $_SERVER['DOCUMENT_ROOT'] . implode('/',array_slice(explode('/',$_SERVER['PHP_SELF']),0,-6))); if (!is_dir('../../img/cms')) mkdir('../../img/cms'); define('CONFIG_SYS_DEFAULT_PATH', '../../img/cms'); //accept relative path only define('CONFIG_SYS_ROOT_PATH', '../../img/cms'); //accept relative path only Replace with: //check if folder exist define('CONFIG_SYS_MY_DOCROOT', $_SERVER['DOCUMENT_ROOT'] . implode('/',array_slice(explode('/',$_SERVER['PHP_SELF']),0,-6))); if (!is_dir(CONFIG_SYS_MY_DOCROOT.'/ROOT-PS/img/cms/')) mkdir(CONFIG_SYS_MY_DOCROOT.'/ROOT-PS/img/cms/'); define('CONFIG_SYS_MY_DOCROOT', $_SERVER['DOCUMENT_ROOT'] . implode('/',array_slice(explode('/',$_SERVER['PHP_SELF']),0,-6))); define('CONFIG_SYS_DEFAULT_PATH', CONFIG_SYS_MY_DOCROOT.'/ROOT-PS/img/cms/'); define('CONFIG_SYS_ROOT_PATH', CONFIG_SYS_MY_DOCROOT.'/ROOT-PS/img/cms/'); Taking care to replace PS-ROOT with the directory where your Prestashop is installed. Bug: after the change, you need to manually update the display of the filemanager Always have a backup 1 Link to comment Share on other sites More sharing options...
elgris Posted July 19, 2012 Share Posted July 19, 2012 Hi Eugenata, I tested your code in PS 1.4.8.2 and works just OK. Thanks a Lot!! Link to comment Share on other sites More sharing options...
Fernandoidim Posted August 22, 2012 Share Posted August 22, 2012 Sei que parece muito idiota, mas não consigo transcrever em codigo o diretório que substitui o PS-ROOT. seria... /www.minhaloja.com.br/, parece que não porque não funciona. Pode me dar uma dica? Link to comment Share on other sites More sharing options...
eugenata Posted August 23, 2012 Share Posted August 23, 2012 Hi Fernandoidim, in your case prestashop is installed in the domain root. So the path to the image folder is only: /img/cms/ without any PS-ROOT. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now