SMF icon indicating copy to clipboard operation
SMF copied to clipboard

Undefined index in upgrade.php

Open margarett opened this issue 12 years ago • 3 comments

I'm trying to convert a user's forum. Since I don't have the admin password, I used the "disable_security=true" thing. At second screen, I get this: Notice: Undefined index: passwrd in C:\xampp\htdocs\work\upgrade.php on line 1178 It seems to come from here: .......name : ''), $_REQUEST['passwrd'], (!empty($password)...........

margarett avatar Nov 22 '14 23:11 margarett

Are you still experiencing this issue?

NanoSector avatar Dec 05 '14 21:12 NanoSector

Yes. I can reproduce it easily with an upgrade from a clean 2.0.9 install in my localhost. Even with the package just downladed from here ;-)

edit: line is now 1180

edit2: this easily fixed by changing the check of "!$disable_security" to the beggining of the "if"

if ((empty($sha_passwd) || (!empty($password) ? $password : '') != $sha_passwd) && !hash_verify_password((!empty($name) ? $name : ''), $_REQUEST['passwrd'], (!empty($password) ? $password : '')) && empty($upcontext['username_incorrect']) && !$disable_security)

To

if (!$disable_security && (empty($sha_passwd) || (!empty($password) ? $password : '') != $sha_passwd) && !hash_verify_password((!empty($name) ? $name : ''), $_REQUEST['passwrd'], (!empty($password) ? $password : '')) && empty($upcontext['username_incorrect']))

I would send a PR for this but I don't have SourceTree in this computer, sorry :(

margarett avatar Dec 11 '14 00:12 margarett

I'll look into this once I have access to my laptop again, thanks :)

NanoSector avatar Dec 11 '14 12:12 NanoSector