Skip to content

Fix error return values in WikiPage::getSection and setText #116

@Xymph

Description

@Xymph

Commit aeaa486 introduced checks in getSection() for undefined sections that return false if not found. This is inconsistent with other methods (e.g. getText(), Wikimate::download() and many Wikifile methods) which return null to indicate error (and otherwise a string or array). Only boolean methods should return false upon error, I think.

Also, recent commit 0a00740 returns a null upon error in boolean method setText(), which should be false.

The getSection change is somewhat API breaking -- the difference is only noticeable when testing with '===' and '!==' but I did that in some of my client scripts -- so it should go in just before we bump to v1.0.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions