niccol:
While I agree entirely with what scriptjunkie says about extraneous code there are perhaps a few exceptions.
I haven't looked at this really closely but the line of code is 'sanitising' the alt tag before it is output. What that means effectively is that it is removing the double quotes from the alt tag if they are there. Why? Well if you think of an image tag:
<img src="whatever" alt="alt-text"/>
```
>
> you can see that if the alt-text contains a double quote like this ( alt"-"text ) then you are going to end up with poorly formed html. Something like:
>
> ```
<img src="whatever" alt="alt"-"text"/>
```
>
> which means that the double quotes in the image tag are messed up.
>
> That is just an example, htmlentities turns a list of characters into their html entities. It is often used for sanitising user input before it is sent to a web page both for practical and security reasons. Have a read of <http://php.net/manual/en/function.htmlentities.php> to find out more about what it does.
>
> Personally, I think it would be fine to make sure that all your image names do not contain any strange characters and then just comment out this line. But I am probably going to get seriously criticised for that comment :smile: Or you could write a bit of a replacement for htmlentities. Something like:
>
> ```
$alt = addslashes(str_replace('"','',$alt))
```
>
> Which just removes any double quotes but doesn't do anything else so is not nearly as complete a solution. So, you could write a much more complete bit of code that, for instance removed any characters that were not a-z or 1-9. Something like:
>
> ```
$alt= preg_replace("/[^a-zA-Z0-9\s]/", "", $alt);
```
>
> None of this is tested so.....
I don't know if you will be criticised Nick, but your post #676 saved me the trouble of deleting thousands (literally) entries from the cache folder every day.
I'm using character set ISO-8859-7 (Greek) and accidentally found that there were about 25000 error logs in my cache folder created within less than 10 days from installing IH3. Your reply prompted me to risk and try in a test environment and it worked with two small variations. I replaced line 690 from:
$alt = addslashes(htmlentities($alt, ENT_COMPAT, CHARSET));
```to
$alt = addslashes(str_replace('"',''',$alt));
after I restored the missing semi-colon at the end and replaced the empty string with a single quote. So, alt tags with double quotes became alt tags with single quotes and the logs are not produced any more. For some reason, the script also changes the title tag.
Many, many, many thanks for your idea and wishes for a nice Christmas and a happy New Year.