On Sun, Sep 21, 2008 at 8:53 PM, Aryeh Gregor
<Simetrical+wikilist(a)gmail.com> wrote:
On Sun, Sep 21, 2008 at 2:38 PM, Roan Kattouw
<roan.kattouw(a)home.nl> wrote:
This makes me wonder: I thought the Title
constructor returned null when
asked to create such titles? Has this behavior changed? If not, I'm very
curious how on earth an invalid Title object manages to 1) exist and 2)
find its way into EditPage::doEdit().
A wikilink like [[#Foo]] corresponds to a Title object with no text,
only a fragment. This is perfectly valid and makes plenty of sense
for links. It's just not a kind of Title that you want to add to the
database.
Another case you have to look out for is non-local Titles, i.e.,
Titles with an interwiki component. Titles with negative namespaces
are also valid but can't be put in the database. There are probably
other cases too. I don't know if the API will handle all of those
correctly right now.
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
In that case we should perhaps have a Title::isValidDbKey and call
that from Article:doEdit and similar.
Bryan