TwistedInteractive / ckeditor

Symphony CMS extension that provides the CKEditor WYSIWYG editor for text fields.
http://symphony-cms.com/download/extensions/view/35082/
Other
19 stars 24 forks source link

URL with more than one 'symphony' string make "File browser" not work #18

Open r00dY opened 12 years ago

r00dY commented 12 years ago

Hello kanduvisla,

In ckeditor/assets/filebrowser.js, line 8:

Symphony.WEBSITE = window.location.toString().match(/^(.+?)\/symphony/)[1];

you use "lazy plus", I mean ".+?" regexp.

I've put up new environment recently, and URL to my new project's symphony administration panel looked this way:

http://127.0.0.1/symphony/PROJECT/symphony/

Unfortunately, your way of extracting Symphony.WEBSITE gives only http://127.0.0.1, because regexp stops after first symphony string. If you use "greedy plus" (only .+, without ?), it would properly give http://127.0.0.1/symphony/PROJECT and this makes file browser work properly.

It took me quite a bit to look this bug up! I hope that my little contribution will help somebody in the future ;)

cheers

kanduvisla commented 12 years ago

Could you make a pull request for this?