@GoZ: See these lines:
Here inside str_replace we are searching for the "&amp...

Contribution Date
Technology
Contribution Project
Contribution Details

@GoZ: See these lines:
Image removed.

Here inside str_replace we are searching for the "&" and replacing it with Image removed. which works well if string does not contain any encoded html entities. Like you tested. But this is not the case to reproduce this bug. Use a string contains already encoded html entities. like the following string:
Image removed.
The str_replace output will look like this:
Image removed.

Not sure rest of the code takes care of this situation.

Contribution Author
Files count
4
Patches count
0