What steps will reproduce the problem?
- If the image tags in the buildings are lowercase instead of upper case, they don't get converted to IMG_NAME properly. I ran into this when migrating from the old 1.3b1 version of the logger to 1.6.2.
- Some recent freak hacks were showing up with <img/>blah.png tags instead of <img>blah.png</img>. This was NOT using the 1.6.2 upload scripts, but still the old 1.3b1 scripts. These hacks weren't fixed at all.
What is the expected output? What do you see instead?
The lowercase version of the tags were not being updated to IMG_NAME, and the <img/> tags remained broken
What version of the product are you using? On what operating system?
This was migrating from 1.3b1 to 1.6.2. It's a Apache2 + PHP 5.1 install on a Mac OSX machine.
Please provide any additional information below.
Making the following change to fix_hack_img.php clears up both problems:
Replace line 16:
$buildings_new = str_ireplace("IMG>", "IMG_NAME>", $hack["buildings"]);
With:
$buildings_new = str_ireplace("IMG>", "IMG_NAME>", $hack["buildings"]);
$pattern = '/img\/>(.*?)</i';
$replace = 'IMG_NAME>$1</IMG_NAME><';
$buildings_new = preg_replace($pattern, $replace, $buildings_new);
I did use this to successfully fix all the broken hacks I had in my logger.