mirror of
https://github.com/godotengine/godot-asset-library.git
synced 2026-01-04 14:10:53 +03:00
Merge pull request #299 from Calinou/provider-tweak-error-message
Tweak error message on invalid download commit if not using Custom provider
This commit is contained in:
@@ -25,7 +25,7 @@ class Utils
|
||||
if ($provider != 'Custom') {
|
||||
// Git commits are either 40 (SHA1) or 64 (SHA2) hex characters
|
||||
if (sizeof(preg_grep('/^[a-f0-9]{40}([a-f0-9]{24})?$/', [$commit])) == 0) {
|
||||
$warning[] = "Using git tags or branches is no longer supported. Please give a full git commit hash instead.\n";
|
||||
$warning[] = "Using Git tags or branches is no longer supported. Please give a full Git commit hash instead, or use the Custom download provider for GitHub Releases downloads.\n";
|
||||
}
|
||||
}
|
||||
switch ($provider) {
|
||||
|
||||
@@ -106,7 +106,7 @@ function _insert_asset_edit_fields($c, $error, &$response, $query, $body, $requi
|
||||
// Git commits are either 40 (SHA1) or 64 (SHA2) hex characters
|
||||
if (sizeof(preg_grep('/^[a-f0-9]{40}([a-f0-9]{24})?$/', [$body['download_commit']])) == 0) {
|
||||
$error = $c->utils->ensureLoggedIn($error, $response, $body, $user);
|
||||
$error = $c->utils->errorResponseIfNotUserHasLevel($error, $response, $user, 'moderator', 'Using git tags or branches is no longer supported. Please give a full git commit hash instead.');
|
||||
$error = $c->utils->errorResponseIfNotUserHasLevel($error, $response, $user, 'moderator', 'Using Git tags or branches is no longer supported. Please give a full Git commit hash instead, or use the Custom download provider for GitHub Releases downloads.');
|
||||
if ($error) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user