This repository has been archived by the owner on Dec 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update slash encoding to use
#
rather than |
When a subpage is exported, or the namespace of an exported page contains a `/`, PagePort previously put the content of the page in a file where the `/` was replaced with a `|`, so that extra slashes in page names or namespaces would not result in increasing levels of sub directories in the package output. The `|` was presumably chosen to ensure that the encoded name would not conflict with any real page names, since `|` is not support for page titles in MediaWiki. However, `|` is also not supported in file names on Windows machines. Instead, encode the `/` with a `#`, which is likewise not allowed in MediaWiki page titles, but *is* allowed in Windows file names. While the behavior for new exports is to use `#`, any existing export that uses `|` can still be imported, and a test case is added to verify that backwards compatibility is not broken. The default version of packages exported is now 0.2 rather than 0.1 to allow packages without explicit versions to be identified as coming after this fix. Additionally, split `PagePortTest::testImport()` to avoid deleting the pages after exporting; it seems that PHPUnit only runs `setUp()` *once* for each test method, even if a test method uses a data provider. Thus, the deletion at the end of the first execution of `testImport()` was breaking the export of the same pages in the second execution that was added. Instead, add a separate `PagePortTest::testDelete()` test. SEL-1609
- Loading branch information
Showing
2 changed files
with
77 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters