if alt="", then it gets outputted as [].
// ' [${1}] ' is the issue.
preg_replace(
'/<img\s[^>]*alt=["\']([^"\']*)["\'][^>]*>/i',
variable_get('basic_metatags_use_alt_attribute', FALSE) ? ' [${1}] ' : '',
$text
)
Comments
Comment #1
avpadernoI think it should be enough to replace
oreg_replace()withpreg_replace_callback(); doing so, the code would replace the tag img with an empty string when the attribute alt is not present, and with the attribute alt surrounded by square brackets when the attribute alt is present.The alternative is to use
${1}in the code shown.Comment #2
avpadernoI opted for the easier solution, which was how version 6.x-1.0 worked.
If the code should be changed, feel free to re-open this issue.
Thanks for the report.