Menu

#35 PHP5 gmmktime() expects parameter 3 to be long, string given

open
nobody
None
5
2006-11-14
2006-11-14
Anonymous
No

Running with PHP 5.2 in E_STRICT error_reporting
this Warning is emmitted:

gmmktime() expects parameter 3 to be long, string given
in magpierss/rss_utils.inc on line 35

The fix is to convert to int on line 35:

$epoch = gmmktime( $hours, $minutes, (int)$seconds,
$month, $day, $year);

I did not look for any other occurence of this.
_______________________________________________________

Below are exact platform infos as produced by phpinfo():

PHP Version 5.2.0

Darwin $hostname 7.9.0 Darwin Kernel Version 7.9.0: Wed
Mar 30 20:11:17 PST 2005;
root:xnu/xnu-517.12.7.obj~1/RELEASE_PPC Power Macintosh

./configure --prefix=/usr/local/php52
--with-zlib-dir=/usr/local --with-gd=/opt/local
--enable-shared=max --enable-module=most
--with-apxs=/usr/sbin/apxs
--with-mysql=/usr/local/mysql
--with-pgsql=/usr/local/pgsql
--with-pdo-mysql=/usr/local/mysql
--with-pdo-pgsql=/usr/local/pgsql --with-pdo-sqlite
--enable-sqlite-utf8 --with-png-dir=/usr/local
--with-ctype --with-libxml-dir=/opt/local
--with-freetype-dir=/opt/local --with-t1lib=/opt/local
--with-iconv-dir=/opt/local --with-jpeg-dir=/opt/local
--with-png-dir=/opt/local --enable-exif

Discussion

  • Nobody/Anonymous

    Logged In: NO

    This fixes a bug with timestamps harvested from Craigslist. Good work.

     
  • Jacob F.

    Jacob F. - 2007-07-06

    Logged In: YES
    user_id=1386245
    Originator: NO

    This is actually the result of a typo in the regex pattern used by the function, see bug [1433477] for the solution.

     

Log in to post a comment.