Bryan Tong Minh schreef:
> On Tue, Sep 30, 2008 at 4:37 PM, Marcus Ramsden <[EMAIL PROTECTED]> wrote:
>   
>> The specific error is that it appears that wiki global $wgTitle does not
>> have a value in it. Is there a way to check where the request originates
>> from, be it the browser or a request through the API. If I could ascertain
>> this then I would be able to instruct my extension to not register any
>> functions which rely on some of the wiki globals being set.
>>
>>     
>
> A terrible hack would be something like isset($GLOBALS['processor']))
> but I think we should add something like define('API', 1) in api.php
> so that you can check defined('API')
While we should have define('API', 1); , for now is_null($wgTitle) will 
do. So if you add

global $wgTitle;
if(is_null($wgTitle))
        return true;

on top of all your hook functions that use $wgTitle, you should be fine.

Roan Kattouw (Catrope)

_______________________________________________
Mediawiki-api mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api

Reply via email to