parse gallery_resize width and height
Submitted PrinceOfAbyss, Mar 13 2012 07:03 PM | Last updated Mar 13 2012 07:03 PM
Below I paste a part of public function inlineResize( $tag, $width, $height ) in admin/applications_addon/ips/gallery/sources/classes/gallery.php
Well, there are two bugs in this piece of code:
1: $tag = preg_replace( "#height='([^']+?)'#", "height='" . $width . "'", $tag ); should obviously be $height.
2. In both if statements, you forgot to include the else parts... So, in the case width and height tags are not included in the original imagetag, the function doesn't actually add a pair of dimensions for it.
I'm not sure where I have to fill in the version of Gallery this report applies to, so let me mention I'm talking about IP.Gallery v4.1.1
/* Quickly resize */
if ( strstr( $tag, "width='" ) )
{
$tag = preg_replace( "#width='([^']+?)'#", "width='" . $width . "'", $tag );
}
if ( strstr( $tag, "height='" ) )
{
$tag = preg_replace( "#height='([^']+?)'#", "height='" . $width . "'", $tag );
}
if ( strstr( $tag, "cover_img___xx___") )
{
$tag = str_ireplace( "cover_img___xx___", "cover_img_" . $width, $tag );
}
return $tag;
Well, there are two bugs in this piece of code:
1: $tag = preg_replace( "#height='([^']+?)'#", "height='" . $width . "'", $tag ); should obviously be $height.
2. In both if statements, you forgot to include the else parts... So, in the case width and height tags are not included in the original imagetag, the function doesn't actually add a pair of dimensions for it.
I'm not sure where I have to fill in the version of Gallery this report applies to, so let me mention I'm talking about IP.Gallery v4.1.1
| Status: | Fixed |
| Version: | 4.1.0 |
| Fixed In: | 5.0.0 Beta 1 |











4 Comments
Looks like Tracker has old problem again...
We do not see those lines that you just put a screen shot....
Some how we do not see confirmed or other kind in-line information on tracker...