Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

PHPPDO and MD5() function

edited February 2011 in Vanilla 2.0 - 2.8
Greetings,

First of all let me express all my emotions - this software is far the best, so fresh. I am really in love now :)

Thanks for the solution. Tried to follow all the steps but it looks like it does not work for the latest available version correctly. I am trying the vanilla-core-2.0.17.8 and have this error:

FUNCTION DATABASE_NAME.md5 does not exist
insert GDN_User (Name, Password, Email, ShowEmail, Gender, DateOfBirth, DateFirstVisit, DateLastActive, DateInserted, DateUpdated, Admin, UserID) values (:Name, md5(:Password), :Email, :ShowEmail, :Gender, :DateOfBirth, :DateFirstVisit, :DateLastActive, :DateInserted, :DateUpdated, :Admin,

It looks like I don't have MD5 but I'm sure it exists as I have other scripts that use that MySQL function and it works fine. I have PHPPDO 1.4

Please advise if any solutions exist. Thanks a lot in advance

Edit:
I managed to fix this but that's not a way to go. I would like to fix this permanently for all md5() calls. Right now I just commented this line:
$Fields['Password'] = array('md5' => $Fields['Password']);
and add the following one below it:
$Fields['Password'] = md5($Fields['Password']);

That's in /applications/dashboard/models/class.usermodel.php file.

Please advise.
Tagged:

Comments

  • It is very very special that you do not have the MD5 function.
    It's probably an apache plugin, just like PDO is.
    PDO and MD5 are not related.

    Here's what you should do to start with:
    • Make a new, empty file
    • In that new, empty file, place the following code <?php phpinfo(); ?>
    • Then save and access that file.
    • You will see everything that is loaded by apache. See if the MD5 plugin is in there
    • Do NOT post the contents of your phpinfo here :-) there are other ways for that.

    There was an error rendering this rich post.

  • edited February 2011
    Thanks for your reply, but I suppose you need to check it a bit deeper ;) I do have some scripts that use MD5 on my server - they use MySQL MD5() function and it works fine.

    I will send a PM to you with the link to phpinfo()

    Edit:
    I've just ran this query in my phpMyAdmin:
    INSERT INTO `test` (`test_field`) VALUES(MD5('test'));
    It worked fine also result is '098f6bcd4621d373cade4e832627b4f6'. Please advise.
    PM sent.

    Thanks for your help
  • mysql md5 and php md5 are not the same, vanilla is surely using php md5 to compute the hash. So check this as asked by UnderDog.
  • thanks for your input luc, anyway if you read my fix you can see it works fine when I use php md5() I added that line to avoid MySQL md5() function.

    Right now the forums work ok, but I think you really need to find a common solution for other members who might have the same problem.
Sign In or Register to comment.