manu37 / tinymce4

tinymce4_XH - tinyMCEv4 for CMSimple_XH
GNU General Public License v3.0
1 stars 3 forks source link

Fix #16: Issues with non UTF-8 encoded filenames #17

Closed cmb69 closed 7 years ago

cmb69 commented 7 years ago

Non UTF-8 encoded filenames in userfiles/images/ or userfiles/downloads/ caused the editor initialization to fail. We fix this by simply ignoring such files by virtue of preg_match() with an u modifier returning null in case of invalid UTF-8. We also make sure that we never truncate a UTF-8 string at an invalid position by using utf8_substr().

cmb69 commented 7 years ago

An alternative variant to solve #16, for your consideration.