Make WordPress Core

Opened 3 years ago

Last modified 3 years ago

#42429 new defect (bug)

Incorrect access level on $message property in class getid3_exception

Reported by: yrpwayne Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.8.3
Component: General Keywords: reporter-feedback
Focuses: Cc:


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 (2)

#1 @obenland
3 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
3 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.

Note: See TracTickets for help on using tickets.