Incorrect GD version display in debug output Incorrect GD version display in debug output
 

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]

Main Menu

Incorrect GD version display in debug output

Started by Joachim Müller, September 06, 2004, 09:48:15 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Joachim Müller

Casper has reported this issue before (I can't find the thread where he reported this issue): apparently for more recent versions of php than I have access to the GD info in debug_output didn't work - it used to display "GD module not found", although it actually existed on the server. I tried to apply a fix (check out the devel branch), but I'm not sure if it works (as I don't have access to more recent versions of PHP than 4.3.3, and I can't upgrade the existing installs). Please test and mark this thread as fixed if it works for you. Thanks.

Joachim

Casper

Hi Joachim,

this was first reported here,
and discussed here, and by subsequent pm.
Thought it was fixed, but will retest.
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

Casper

Well, I was wrong it's not fixed.

The problem is this.

The debug output shows;
QuoteModule: gd
------------------
module doesn't exist
==========================
Module: mysql
------------------
module doesn't exist

This is of course incorrect, both modules exist and are in use.  The phpinfo accessed through admin tools is correct.

The server this happens on uses php version 4.2.2.  This only appears to happen for GD1, if GD2 then it works correctly.
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

Joachim Müller

Casper, you sent me your phpinfo html output the other day so I could look into this. Could you send it once again please? Thanks.

Joachim

Casper

Hi Joachim,

here is a copy of the output, as displayed i the debug info.
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

Joachim Müller

hrm, I should have specified this even more: I need the html output that get's generated if you actually run a phpinfo file on your server (<?php phpinfo(); ?>), as the debug output uses the module definition in php if it exists - if it doesn't, it falls back to the html output from phpinfo that is being flushed into a var and then checked for existance of some patterns. As I will have to adjust those patterns, I need the actual html output (not just plaintext).

Joachim

Casper

Attached file is the full html source code for the info.php
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

Joachim Müller

just bumping this thread to the first page - will have to look into this issue (self-assign).

Joachim

Casper

I can't figure this out.  But I would put this at the bottom of the list for jobs needed doing, as we know about it, and the info given from the admin tools phpinfo is correct, can we just not mark this as a known issue for now, and ask users to get their info from admin tools.
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

Joachim Müller

I committed to the devel branch of the cvs these changes:
Quotefunction cpg_phpinfo_mod($search)
{
    // this could be done much better with regexpr - anyone who wants to change it: go ahead
    ob_start();
    phpinfo(INFO_MODULES);
    $string = ob_get_contents();
    $module = $string;
    $delimiter = '#cpgdelimiter#';
    ob_end_clean();
    // find out the first occurence of "<h2" and throw the superfluos stuff away
    $string = stristr($string, 'module_' . $search);
    $string = eregi_replace('</table>(.*)', '', $string);
    $string = stristr($string, '<tr'); // changed '<tr>' to '<tr', as older versions of php had the table row formatted by html means
    $string = str_replace('</td>', '|', $string);
    $string = str_replace('</tr>', $delimiter, $string);
    $string = chop(strip_tags($string));
    $pieces = explode($delimiter, $string);
    foreach($pieces as $key => $val) {
        $bits[$key] = explode("|", $val);
    }
    return $bits;
}
Casper, could you please check and confirm, so I can add this to the stable branch as well? Thanks

Joachim

Joachim Müller

*bump*
Casper, could you please test this?

Joachim

Casper

Sorry for the wait, I'd all but stopped testing on that server.

Yes, your changes work fine, the info is now given correctly, thanks.
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