Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bbff717a24 | |||
| 6d8b2c33cb | |||
| 47eef3c35d | |||
| 7f51c4f310 |
@@ -68,6 +68,7 @@ This extension can be configured using the `LocalSettings.php` file in your Medi
|
||||
- `UploadComplete` - File was uploaded
|
||||
- `FileDeleteComplete` - File revision was deleted
|
||||
- `FileUndeleteComplete` - File revision was restored
|
||||
- `AfterImportPage` - Page was imported
|
||||
|
||||
## Translation
|
||||
This extension can be translated through the messages in the `ì18n` folder if you're a developer. As a wiki administrator, you may find it a better option to edit the messages on-site in the MediaWiki namespace.
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
"[https://github.com/jaydenkieran Jayden Bailey]"
|
||||
],
|
||||
"url": "https://github.com/jaydenkieran/mw-discord",
|
||||
"version": "1.0.8",
|
||||
"version": "1.0.10",
|
||||
"descriptionmsg": "discord-desc",
|
||||
"license-name": "MIT",
|
||||
"manifest_version": 1,
|
||||
|
||||
+5
-1
@@ -73,7 +73,7 @@ class DiscordUtils {
|
||||
$stripped = $dateString . ' ' . $stripped;
|
||||
}
|
||||
|
||||
DeferredUpdates::addCallableUpdate( function() use ( $stripped, $urls ) {
|
||||
DeferredUpdates::addCallableUpdate( function() use ( $stripped, $urls, $wgDiscordUseFileGetContents ) {
|
||||
$user_agent = 'mw-discord/1.0 (github.com/jaydenkieran)';
|
||||
$json_data = [ 'content' => "$stripped" ];
|
||||
$json = json_encode($json_data);
|
||||
@@ -111,6 +111,9 @@ class DiscordUtils {
|
||||
curl_setopt( $c_handlers[$value], CURLOPT_CONNECTTIMEOUT, 10 ); // Add a timeout for connecting to the site
|
||||
curl_setopt( $c_handlers[$value], CURLOPT_TIMEOUT, 10 ); // Do not allow cURL to run for a long time
|
||||
curl_setopt( $c_handlers[$value], CURLOPT_USERAGENT, $user_agent ); // Add a unique user agent
|
||||
curl_setopt( $c_handlers[$value], CURLOPT_HTTPHEADER, array(
|
||||
'Content-Type: application/json'
|
||||
));
|
||||
curl_multi_add_handle( $mh, $c_handlers[$value] );
|
||||
}
|
||||
|
||||
@@ -122,6 +125,7 @@ class DiscordUtils {
|
||||
// Remove all handlers and then close the multi handler
|
||||
foreach($c_handlers as $k => $ch) {
|
||||
$result[$k] = curl_multi_getcontent($ch);
|
||||
wfDebugLog( 'discord', 'Result of cURL was: ' . $result[$k] );
|
||||
curl_multi_remove_handle($mh, $ch);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user