Make WordPress Core

Opened 6 years ago

Closed 3 years ago

#42429 closed defect (bug) (invalid)

Incorrect access level on $message property in class getid3_exception

Reported by: yrpwayne's profile yrpwayne Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.8.3
Component: External Libraries Keywords:
Focuses: Cc:

Description

In the file: wp-includes/ID3/getip3.php

on line: 1795

class getid3_exception extends Exception
{
	public $message;
}

Should be

class getid3_exception extends Exception
{
	protected $message;
}

Change History (3)

#1 @obenland
6 years ago

  • Keywords reporter-feedback added

Given that $message is a protected property in the original Exception class, I don't see a reason for the existence of getid3_exception other than changing the access level on that property. What do you think?

#2 @yrpwayne
6 years ago

Yes well, that seems to be what's happening. I assume it was done for testing because I cannot find any use of the exposed property or reason for it.

Also, you can call getMessage() if you need to read the contents and you should create a new instance if you need to modify it.

Looking with a clearer head in the morning I see it is a 3rd party library, so I’ll move this issue over there and see if there’s a good reason.

#3 @hellofromTonya
3 years ago

  • Component changed from General to External Libraries
  • Keywords reporter-feedback removed
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

The code in question is part of an external library. As @yrpwayne notes,

Looking with a clearer head in the morning I see it is a 3rd party library, so I’ll move this issue over there and see if there’s a good reason.

Closing to be/was reported upstream.

Note: See TracTickets for help on using tickets.