[Mediawiki-api] Write API should be restricted to logged-in users only

Max Semenik maxsem.wiki at gmail.com
Sun May 25 18:50:18 UTC 2008


On 25.05.2008, 22:20 Bryan wrote:

>>>> I think I added that hook on the wrong place. It should probably
>>>> somewhere after the title has been set.
>>>>
>>>> Bryan
>>>>
>>> ...or not. It appears that the error occurs because $wgTitle is not
>>> set. It should probably be set to something sensible or $wgOut should
>>> be set to a fake object that does nothing.
>>
>>> Bryan
>>
>> Probably, something like FauxOutputPage should relly be made, but it
>> would add extra time to load it and actual OutputPage from which it
>> will inherit. So my proposed patch modifies AssertEdit's behaviour to
>> depend on entry point and not to output anything if it's called from
>> API.
>>
>> --
>> Best regards,
>>  Max Semenik ([[User:MaxSem]])
>>
>>

> Thanks for the patch, but I don't really like how it depends on
> $GLOBAL['processor'] to check whether we are running through the api.
> There should be a more sane way to detect runnage via the API and if
> there is not, it really should be made.

> Bryan

How about define( 'API' ); in api.php just before constructing
ApiMain?

-- 
Best regards,
  Max Semenik ([[User:MaxSem]])




More information about the Mediawiki-api mailing list