Index: trunk/extensions/Lingo/LingoMessageLog.php |
— | — | @@ -30,14 +30,22 @@ |
31 | 31 | |
32 | 32 | function addMessage( $message, $severity = self::MESSAGE_NOTICE ) { |
33 | 33 | $this->mMessages[] = array($message, $severity); |
| 34 | + |
| 35 | + // log errors and warnings in debug log |
| 36 | + if ( $severity == self::MESSAGE_WARNING || |
| 37 | + $severity == self::MESSAGE_ERROR ) { |
| 38 | + wfDebug( $message ); |
| 39 | + } |
34 | 40 | } |
35 | 41 | |
36 | 42 | function addError( $message ) { |
37 | 43 | $this->mMessages[] = array($message, self::MESSAGE_ERROR); |
| 44 | + wfDebug( "Error: $message\n" ); |
38 | 45 | } |
39 | 46 | |
40 | 47 | function addWarning( $message ) { |
41 | 48 | $this->mMessages[] = array($message, self::MESSAGE_WARNING); |
| 49 | + wfDebug( "Warning: $message\n" ); |
42 | 50 | } |
43 | 51 | |
44 | 52 | function addNotice( $message ) { |
Index: trunk/extensions/Lingo/LingoBasicBackend.php |
— | — | @@ -29,7 +29,13 @@ |
30 | 30 | parent::__construct( $messages ); |
31 | 31 | |
32 | 32 | // Get Terminology page |
33 | | - $rev = Revision::newFromTitle( Title::makeTitle( null, $page ) ); |
| 33 | + $title = Title::newFromText( $page ); |
| 34 | + if ( $title->getInterwiki() ) { |
| 35 | + $this->getMessageLog()->addError( wfMsgReal( 'lingo-terminologypagenotlocal', array($page) ) ); |
| 36 | + return false; |
| 37 | + } |
| 38 | + |
| 39 | + $rev = Revision::newFromTitle( $title ); |
34 | 40 | if ( !$rev ) { |
35 | 41 | $this->getMessageLog()->addWarning( wfMsgReal( 'lingo-noterminologypage', array($page) ) ); |
36 | 42 | return false; |
Index: trunk/extensions/Lingo/Lingo.i18n.php |
— | — | @@ -12,6 +12,7 @@ |
13 | 13 | 'lingo-desc' => 'Provides hover-over tool tips on pages from words defined on the [[$1]] page', |
14 | 14 | 'lingo-terminologypagename' => 'Terminology', |
15 | 15 | 'lingo-noterminologypage' => '[[$1]] does not exist.', |
| 16 | + 'lingo-terminologypagenotlocal' => '[[$1]] is not a local page.', |
16 | 17 | |
17 | 18 | ); |
18 | 19 | |