WordPress.org

Ready to get started?Download WordPress

Forums

01-08 Nightly - big, bad booboo (14 posts)

  1. RustIndy
    Member
    Posted 9 years ago #

    It seems that the mysql2date() function in "functions.php" is only meant to accept full date vals like "2005-01-06 08:04:36", but with the latest nightly, it sometimes receives time-serial values instead like "1105027476".

    Obviously, this is causing a few errors to appear anywhere the post time is shown ;) Oddly, the comment times are unaffected...

  2. RustIndy
    Member
    Posted 9 years ago #

    Quick hack-fix for "/wp-includes/functions.php":

    Change the line

    $i = mktime(substr($m,11,2),substr($m,14,2),substr($m,17,2),substr($m,5,2),substr($m,8,2),substr($m,0,4));

    to read

    if (strlen($m) > 17) {
    $i = mktime(substr($m,11,2),substr($m,14,2),substr($m,17,2),substr($m,5,2),substr($m,8,2),substr($m,0,4));
    } else {
    $i = $m;
    }

    It's an ugly hack, but it's quick and it works :)

  3. Proton
    Member
    Posted 9 years ago #

    Looks like I'm not the only one affected :P Phew.

  4. got3n
    Member
    Posted 9 years ago #

    LMAO, i did the exact thing when i saw this, then was bout to post it when you did, GRRRR! ::shakesx fist::

  5. RustIndy
    Member
    Posted 9 years ago #

    Hehe :) Keep an eye on http://codex.wordpress.org/Changelog/1.5 for nightly changelogs too, should be a good help if you're updating your files regularly.

  6. 7milesdown
    Member
    Posted 9 years ago #

    ^^ thats how I been doing it! Great resource!

  7. parisgv
    Member
    Posted 9 years ago #

    Guys, i have changed the link on fuctions.php but it still says on my news

    December 31st, 1969
    instead of December 31st, 2004

    url: http://www.justshannen.com/fansite

  8. parisgv
    Member
    Posted 9 years ago #

    OK! Problem has been fixed!
    I just have to post-again a message, a new one so, all past messages change from year 1969 to 2004 or 2005! FIXED, thanks! :)

  9. RustIndy
    Member
    Posted 9 years ago #

    That's because your host is running a *nix server. A windows server can only go back to 00:00:01 Jan 1 1970 - using PHP's mktime() function on smaller dates gives an error about using negative numbers in the function.

    I think.

    Check that codex link posted above after the nightly gets on the download page - if I find a show-stopper bug or something very obvious to a viewer, it'll be listed there. In general, avoid using the 1.5 nightly if there's a known, obvious bug ;) The Jan7 nightly didn't have the problem.

  10. carthik
    Member
    Posted 9 years ago #

    Do you guys run upgrade.php after you update the files from the nightly?

  11. RustIndy
    Member
    Posted 9 years ago #

    I haven't been usually, no. But I did finally on the Jan7 nightly since it seemed so much had changed. Just seemed like a good idea :)

    I don't think that running "upgrade.php" when you don't need to will hurt anything though, so it's safe to run it whenever you update the WP files. Usually you won't need to though.

    If a nightly comes out that requires running "upgrade.php", it'll be noted in the codex's 1.5 changelog page.

  12. wantmoore
    Member
    Posted 9 years ago #

    The above fix didn't work for me. Maybe I'm just stupid though. I *do* typically run upgrade.php and I have this time as well. Anyone know if a fix is in CVS yet?

  13. RustIndy
    Member
    Posted 9 years ago #

    You're getting errors instead of the article post date on your pages and in the admin section? That's all the fix above does - it just checks to see if the function is being sent a date or a dateserial and fills $i appropriately so that it ends up being a dateserial.

    I'm hoping the Jan9 nightly will either fix the function, or fix the function that calls it. This function (above) can currently only take a full date as a value, not a dateserial.

  14. Ryan Boren
    WordPress Dev
    Posted 9 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.