Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#34558 closed defect (bug) (invalid)

PasswordHash uses PHP 4 style constructor

Reported by: mordauk's profile mordauk Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.4
Component: Users Keywords:
Focuses: Cc:

Description

The PasswordHash class has a PHP 4 style constructor which results in deprecated notices being thrown in PHP 7:

/**
 * PHP4 constructor.
 */
public function PasswordHash( $iteration_count_log2, $portable_hashes ) {
	self::__construct( $iteration_count_log2, $portable_hashes );
}
Methods with the same name as their class will not be constructors in a future version of PHP; PasswordHash has a deprecated constructor

In 4.3, PHP4 style constructors were removed for WP_Widget. I'd love to see this get removed from PasswordHash as well, though I'm not entirely sure it being an upstream library means we just wait until they update it or we go ahead and resolve it here and push back upstream.

Change History (4)

#1 @jorbin
9 years ago

  • Keywords reporter-feedback added

In [32990] we modified Password hash to have the construct method, while keeping the PasswordHash function. This was to ensure there was no breakage. None of our uses of PasswordHash directly call the php4 style constructor (that I can tell). It *should* only be used if someone is subclassing PasswordHash and calling the php4 style constructor.

How were you able to get the deprecation notice? I haven't seen it my running of PHP7.

Version 0, edited 9 years ago by jorbin (next)

#2 @mordauk
9 years ago

  • Resolution set to invalid
  • Status changed from new to closed

I was seeing it in Travis.ci: https://travis-ci.org/pippinsplugins/restrict-content-pro/jobs/88548967

I just realized it's on only WP < 4.3 so this is invalid. Thanks for the quick look!

#3 @netweb
9 years ago

  • Milestone Awaiting Review deleted

#4 @netweb
9 years ago

  • Keywords reporter-feedback removed
Note: See TracTickets for help on using tickets.