Skip to content

Commit

Permalink
fix case 'url'
Browse files Browse the repository at this point in the history
  • Loading branch information
kanasimi committed Nov 29, 2024
1 parent e6e3f89 commit 510ff13
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion application/net/wiki/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -2206,8 +2206,19 @@ function module_code(library_namespace) {
}
break;

case 'commonsMedia':
case 'url':
datavalue_type = 'string';
value = String(value);
/**
* <code>
Error: [modification-failed] URLs are not allowed to contain certain characters like spaces or square brackets: https://doi.org/10.1002/(sici)1098-2825(1997)11:6<315::aid-jcla1>3.0.co;2-4 [wikibase-validator-bad-url] ["https://doi.org/10.1002/(sici)1098-2825(1997)11:6<315::aid-jcla1>3.0.co;2-4"]
</code>
*/
if (/[<>\[\]]/.test(value))
value = encodeURI(value);
break;

case 'commonsMedia':
case 'external-id':
case 'math':
case 'string':
Expand Down Expand Up @@ -5502,6 +5513,7 @@ function module_code(library_namespace) {
+ error);
try {
console.trace([ action, POST_data ]);
// console.log(POST_data.data);
} catch (e) {
library_namespace.warn('action: '
//
Expand Down

0 comments on commit 510ff13

Please sign in to comment.