Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: BUG functions.inc.php v1.3.2: little HTML source misspelling  (Read 2771 times)

0 Members and 1 Guest are viewing this topic.

frankyknife

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
BUG functions.inc.php v1.3.2: little HTML source misspelling
« on: October 23, 2004, 04:18:54 am »

Hi!
i have just checked my CPG test gallery outputs -> the html generated outputs by coppermine.

although the browser interpretation and correct display is not affected, there appears nearly on every page an error in the html source code, cause it has something to do with an image source integration (img src=) generated by 'functions.inc.php'. the height of $image_size['geom'] is not correct defined...:

a wrong " on line 1032:
Code: [Select]
// Compute image geometry based on max width / height
function compute_img_size($width, $height, $max)
{
         global $CONFIG;
        $thumb_use=$CONFIG['thumb_use'];
        if($thumb_use=='ht') {
          $ratio = $height / $max;
        } elseif($thumb_use=='wd') {
          $ratio = $width / $max;
        } else {
          $ratio = max($width, $height) / $max;
        }
        if ($ratio > 1.0) {
                $image_size['reduced'] = true;
        }
        $ratio = max($ratio, 1.0);
        $image_size['width'] = ceil($width / $ratio);
        $image_size['height'] = ceil($height / $ratio);
        $image_size['whole'] = 'width="'.$image_size['width'].'" height="'.$image_size['height'].'"';
        if($thumb_use=='ht') {
          $image_size['geom'] = '" height="'.$image_size['height'].'"';
        } elseif($thumb_use=='wd') {
          $image_size['geom'] = 'width="'.$image_size['width'].'"';
        } else {
          $image_size['geom'] = 'width="'.$image_size['width'].'" height="'.$image_size['height'].'"';
        }



        return $image_size;
}


the correct code has to look like this:
Code: [Select]
// Compute image geometry based on max width / height
function compute_img_size($width, $height, $max)
{
         global $CONFIG;
        $thumb_use=$CONFIG['thumb_use'];
        if($thumb_use=='ht') {
          $ratio = $height / $max;
        } elseif($thumb_use=='wd') {
          $ratio = $width / $max;
        } else {
          $ratio = max($width, $height) / $max;
        }
        if ($ratio > 1.0) {
                $image_size['reduced'] = true;
        }
        $ratio = max($ratio, 1.0);
        $image_size['width'] = ceil($width / $ratio);
        $image_size['height'] = ceil($height / $ratio);
        $image_size['whole'] = 'width="'.$image_size['width'].'" height="'.$image_size['height'].'"';
        if($thumb_use=='ht') {
          $image_size['geom'] = 'height="'.$image_size['height'].'"';
        } elseif($thumb_use=='wd') {
          $image_size['geom'] = 'width="'.$image_size['width'].'"';
        } else {
          $image_size['geom'] = 'width="'.$image_size['width'].'" height="'.$image_size['height'].'"';
        }



        return $image_size;
}



regards,
franky
« Last Edit: October 23, 2004, 04:27:08 am by frankyknife »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: BUG functions.inc.php v1.3.2: little HTML source misspelling
« Reply #1 on: October 23, 2004, 07:15:50 am »

thanks for your report. The line that actually needs changing is
Code: [Select]
$image_size['geom'] = 'height="'.$image_size['height'].'"';It has been reported before and has been changed in the cvs already.

Joachim
Logged

frankyknife

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Re: BUG functions.inc.php v1.3.2: little HTML source misspelling
« Reply #2 on: October 23, 2004, 07:25:55 pm »

It has been reported before and has been changed in the cvs already.

Joachim

what do you mean with "cvs" ?
i have downloaded the current realease of CPG 2 days ago, there the error still exists.

(sorry for double posting, but i searched the forum before without luck!)
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: BUG functions.inc.php v1.3.2: little HTML source misspelling
« Reply #3 on: October 23, 2004, 07:45:50 pm »

The cvs (concurrent versions system) is where all the files are kept, from the first to the latest versions.  it is where the devs put updated files, and it allows us to work on these files without accidentally removing work done by another dev.

The zip file you, and all other users downloaded, does not contain all the latest files, it is the same zip as when 1.3.2 was first packaged.  If we re-packaged the zip every time a file is updated, we would be on version 1.3.lots by now.
If you want any of the updated files, you can get them from the cvs, by clickin on the 'project' link in the menu above, then on 'cvs' and then 'browse the cvs'.

The branch you will want to browse for this version is the 'stable' branch.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 15 queries.