Skip to content

Commit

Permalink
removed strtolower() and trim() on site name check
Browse files Browse the repository at this point in the history
within run_single_command, the site name is checked against the currently available sites. This was done, using the functions strtolower() and trim() to clean up the file name. The only problem is that at no other point in the app are the site names adjusted this way, causing issues, when the site name uses upper case letters or spaces in the beginning and end. 
In wmde/wikibase-release-pipeline#293 I suggested using the same variable to full the site name, as the label, go show to the user which wikibase instance the user is going to write to with the current quickstatement page. For this branding however, users might be inclined to use a name that contains capital letters causing Quickstatements to fail when writing to the API.
  • Loading branch information
DavidFichtmueller authored Mar 14, 2022
1 parent 89c490a commit 9b0827d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion public_html/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function validate_origin() {
} else if ( $action == 'run_single_command' ) {

validate_origin();
$site = strtolower ( trim ( get_request ( 'site' , '' ) ) ) ;
$site = get_request ( 'site' , '' ) ;
if ( !$qs->setSite ( $site ) ) {
$out['status'] = "Error while setting site '{$site}': " . $qs->last_error_message ;
} else {
Expand Down

0 comments on commit 9b0827d

Please sign in to comment.