Skip to content

rebase extension.json work around new codebase #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

MEXAHOTABOP
Copy link
Contributor

@MEXAHOTABOP MEXAHOTABOP commented Jan 2, 2023

Differences from #7 :
Leave code in DFRawFunctions.body.php to make review more easily
Added $wgDFRawVersion varible, that define version with will be used if namespace is not set, that change required for Russian wiki that use only main user space, and should not affect English wiki.
Fixed problem with non evalable by default DFRawPath in extension.json by moving default path DIR . '/raws'; to code

@MEXAHOTABOP
Copy link
Contributor Author

c5b835b
Changes behavior of DFRawPath now this is relative from extension directory, instead of absolute.

"description": "Absolute path to raws directory, when empty use 'raws' directory in extension catalog"
"value": "raws",
"path": true,
"description": "Relative path to raws directory"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't it also be absolute? I don't see any checks for the path root in DFRawFunctions.body.php

Copy link
Contributor Author

@MEXAHOTABOP MEXAHOTABOP Jan 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With "path": true mediawiki insert extension directory to path without any other checks.
So only relative.

https://github.com/wikimedia/mediawiki/blob/9afab251cac5b02564a68c13f25418c522df9467/includes/registration/ExtensionProcessor.php#L831

Default str to int comparison behavior was changed in php8+
https://wiki.php.net/rfc/string_to_number_comparison
with is caused undefined behavior in code.
This commit fixes it by explicitly casting str to int.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants