|
60 | 60 | placeholder="Leave blank for default graph"
|
61 | 61 | />
|
62 | 62 | <div class="invalid-feedback">
|
63 |
| - Invalid graph name. Please remove any spaces. |
| 63 | + Invalid graph name. Please remove any spaces and encoded values. |
64 | 64 | </div>
|
65 | 65 | </div>
|
66 | 66 | </div>
|
|
122 | 122 | <div class="pt-2 pb-2">
|
123 | 123 | <div class="progress" style="height: 1.5rem;">
|
124 | 124 | <div
|
125 |
| - :style="`width: ${uploadSucceededPercentage}%`" |
126 |
| - :aria-valuenow="uploadSucceededPercentage" |
127 |
| - :title="`${uploadSucceededCount}/${uploadCount}`" |
128 | 125 | class="progress-bar"
|
129 | 126 | role="progressbar"
|
| 127 | + :style="`width: ${uploadSucceededPercentage}%`" |
| 128 | + :aria-valuenow="uploadSucceededPercentage" |
130 | 129 | aria-valuemin="0"
|
131 | 130 | aria-valuemax="100"
|
132 | 131 | >
|
133 | 132 | {{ uploadSucceededCount }}/{{ uploadCount }}
|
134 | 133 | </div>
|
135 | 134 | <div
|
136 |
| - :style="`width: ${uploadFailedPercentage}%`" |
137 |
| - :aria-valuenow="uploadFailedPercentage" |
138 |
| - :title="`${uploadFailedCount}/${uploadCount}`" |
139 | 135 | class="progress-bar bg-danger"
|
140 | 136 | role="progressbar"
|
| 137 | + :style="`width: ${uploadFailedPercentage}%`" |
| 138 | + :aria-valuenow="uploadFailedPercentage" |
141 | 139 | aria-valuemin="0"
|
142 | 140 | aria-valuemax="100"
|
143 | 141 | >
|
@@ -327,7 +325,8 @@ export default {
|
327 | 325 | }
|
328 | 326 | const params = (this.datasetGraphName && this.datasetGraphName !== '') ? `?graph=${this.datasetGraphName}` : ''
|
329 | 327 | const dataEndpoint = this.services['gsp-rw']['srv.endpoints'].find(endpoint => endpoint !== '') || ''
|
330 |
| - return this.$fusekiService.getFusekiUrl(`/${this.datasetName}/${dataEndpoint}${params}`) |
| 328 | + const fusekiUrl = this.$fusekiService.getFusekiUrl(`/${this.datasetName}/${dataEndpoint}${params}`) |
| 329 | + return fusekiUrl |
331 | 330 | },
|
332 | 331 | uploadCount () {
|
333 | 332 | if (!this.upload || !this.upload.files) {
|
@@ -418,15 +417,33 @@ export default {
|
418 | 417 | return this.validateGraphName() && this.validateFiles()
|
419 | 418 | },
|
420 | 419 | validateGraphName () {
|
421 |
| - // No spaces allowed in graph names. |
422 |
| - const pattern = /^[^\s]+$/ |
423 | 420 | const graphName = this.$refs['dataset-graph-name'].value
|
424 |
| - if (graphName === '' || pattern.test(graphName)) { |
| 421 | + // An empty graph name is OK. |
| 422 | + if (graphName === '') { |
425 | 423 | this.graphNameClasses = ['form-control is-valid']
|
426 | 424 | return true
|
427 | 425 | }
|
428 |
| - this.graphNameClasses = ['form-control is-invalid'] |
429 |
| - return false |
| 426 | + // No spaces allowed in graph names. |
| 427 | + const pattern = /^\S+$/ |
| 428 | + if (!pattern.test(graphName)) { |
| 429 | + this.graphNameClasses = ['form-control is-invalid'] |
| 430 | + return false |
| 431 | + } |
| 432 | + // Only valid URIs allowed. |
| 433 | + try { |
| 434 | + new URL(graphName) |
| 435 | + } catch { |
| 436 | + this.graphNameClasses = ['form-control is-invalid'] |
| 437 | + return false |
| 438 | + } |
| 439 | + // Encoded components are not allowed. |
| 440 | + if (decodeURI(graphName) !== decodeURIComponent(graphName)) { |
| 441 | + this.graphNameClasses = ['form-control is-invalid'] |
| 442 | + return false |
| 443 | + } |
| 444 | + // If it reached this part, then it's a valid graph name. |
| 445 | + this.graphNameClasses = ['form-control is-valid'] |
| 446 | + return true |
430 | 447 | },
|
431 | 448 | validateFiles () {
|
432 | 449 | if (this.upload.files !== null && this.upload.files.length > 0) {
|
|
0 commit comments