CKEditor没有在<img> tag的alt属性中将单引号转义为其相应的htmlentity

I'm using CKEditor 4.5.11. When I try to insert some data which contains following markup:

<img src="/images/nature.jpg" alt="Nature at it's best" border="0" />

my PHP/MySQL code gets crashed. It can't insert data in database. We know that CKEditor escapes single quote into &#39; but in <img> tag it gets failed. Why? What is the workaround - I mean in config.js?