stefanogualdi / grails-ckeditor

Grails CKEditor plugin
http://grails.org/plugin/ckeditor
Apache License 2.0
23 stars 32 forks source link

BaseUrl is ignored when uploading an image #40

Open DnlOrr opened 6 years ago

DnlOrr commented 6 years ago

I have specified the baseurl and basedir in the configuration however when I upload an image the baseurl is ignored.

In grails-ckeditor/src/main/groovy/grails/plugins/ckeditor/utils/PathUtils.groovy // line 33

static getBaseUrl(params) { def config = Holders.config.ckeditor def baseUrl if (config?.upload?.baseurl) { baseUrl = "" // shouldn't be baseUrl = config.upload.baseurl? } else { baseUrl = config?.upload?.basedir ?: CkeditorConfig.DEFAULT_BASEDIR } baseUrl = PathUtils.checkSlashes(baseUrl, "L- R-", true) def spaceDir = PathUtils.sanitizePath(params.space) if (spaceDir) { baseUrl += "/" + spaceDir } def typeName = PathUtils.sanitizePath(params.type?.toLowerCase()) if (typeName) { typeName = WordUtils.capitalize(typeName) baseUrl += "/" + typeName } return baseUrl }