Added handling for 200 OK responses in Transifex requests

(DBOINCP-141)
This commit is contained in:
Tristan Olive 2015-04-17 13:05:19 -04:00
parent 65fb1d1049
commit 316c42fb52
1 changed files with 12 additions and 0 deletions

View File

@ -420,6 +420,15 @@ function boinctranslate_update_official_boinc_translations() {
);
break;
}
elseif ($result == 'success') {
drupal_set_message("Updated {$language_name} official BOINC translations");
}
else {
drupal_set_message(
"Unexpected response for {$language_name}: {$result}",
'warning'
);
}
}
else {
drupal_set_message("Updated {$language_name} official BOINC translations");
@ -489,6 +498,9 @@ function boinctranslate_transifex_request($path, $post = NULL, $json = TRUE, $us
elseif (strstr($response_header, '405 METHOD NOT ALLOWED')) {
return "ERROR: User not allowed to perform this action";
}
elseif (strstr($response_header, '200 OK')) {
return 'success';
}
}
elseif ($json) {
// Process as JSON