Index: trunk/extensions/EmailCapture/EmailCaptureHooks.php |
— | — | @@ -7,24 +7,15 @@ |
8 | 8 | * LoadExtensionSchemaUpdates hook |
9 | 9 | */ |
10 | 10 | public static function loadExtensionSchemaUpdates( $updater = null ) { |
11 | | - if ( $updater === null ) { |
12 | | - global $wgExtNewTables; |
13 | | - $wgExtNewTables[] = array( |
| 11 | + $dir = dirname( __FILE__ ); |
| 12 | + $db = $updater->getDB(); |
| 13 | + if ( !$db->tableExists( 'email_capture' ) ) { |
| 14 | + // Initial install tables |
| 15 | + $updater->addExtensionUpdate( array( |
| 16 | + 'addTable', |
14 | 17 | 'email_capture', |
15 | 18 | dirname( __FILE__ ) . '/sql/CreateEmailCaptureTable.sql' |
16 | 19 | ); |
17 | | - } else { |
18 | | - $dir = dirname( __FILE__ ); |
19 | | - $db = $updater->getDB(); |
20 | | - if ( !$db->tableExists( 'email_capture' ) ) { |
21 | | - // Initial install tables |
22 | | - $updater->addExtensionUpdate( array( |
23 | | - 'addTable', |
24 | | - 'email_capture', |
25 | | - $dir . '/sql/CreateEmailCaptureTable.sql', |
26 | | - true |
27 | | - ) ); |
28 | | - } |
29 | 20 | } |
30 | 21 | return true; |
31 | 22 | } |
Index: trunk/extensions/EmailCapture/api/ApiEmailCapture.php |
— | — | @@ -9,9 +9,7 @@ |
10 | 10 | $params = $this->extractRequestParams(); |
11 | 11 | |
12 | 12 | // Validation |
13 | | - if ( !isset( $params['email'] ) ) { |
14 | | - $this->dieUsageMsg( array( 'missingparam', 'email' ) ); |
15 | | - } elseif ( !User:isValidEmailAddr( $params['email'] ) ) { |
| 13 | + if ( !User:isValidEmailAddr( $params['email'] ) ) { |
16 | 14 | $this->dieUsage( 'The email address does not appear to be valid', 'invalidemail' ); |
17 | 15 | } |
18 | 16 | |
— | — | @@ -90,7 +88,6 @@ |
91 | 89 | |
92 | 90 | public function getPossibleErrors() { |
93 | 91 | return array_merge( parent::getPossibleErrors(), array( |
94 | | - array( 'missingparam', 'email' ), |
95 | 92 | array( |
96 | 93 | 'code' => 'invalidemail', |
97 | 94 | 'info' => 'The email address does not appear to be valid' |