Remove obsolete code from languages.php #962
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
A few commits to tidy-up the languages.php file by removing redundant or obsolete code.
With open_basedir() in effect, I noticed warnings about trying to access the root directory
Looking into this, it was caused by trying to derive a plugin's own language directory, which I think is now obsolete.
For clarity, there are four commits each removing some code that I think is not needed now.
Plugins have not yet been created when the
phplist_I18N
constructor is called. So the chunk of code trying to derive theplugins basedir is redundant.
The code in the constructor looking for common.php, frontend.php etc is now obsolete. Those files have not existed for quite a while. Removing that chunk of code allows all other references to
$this->lan
to be removed as well.The method getTranslation() takes a
$basedir
parameter that isn't used. Removing that parameter allows code that sets-up the parameter to be removed as well, particularly thegetPluginBasedir
() method.The method getTranslation() takes a
$page
parameter that also isn't used. Removing that parameter allows code that sets-up the parameter to be removed as well.Related Issue
Screenshots (if appropriate):