Files
baserow/web-frontend/modules/database/components/formula/array/FunctionalFormulaButtonArrayItem.vue
T
Davide Silvestri 53d54c06ac chore: improve escaping of URLs and user input in database views (#5670)
* fix(database): improve escaping of URLs and user input

Escape user-provided select option values and colors when building the
database API documentation, and restrict URL, link and button field cell
hrefs to a safe scheme allowlist so non-navigable values are normalised.

Add unit tests for the URL scheme helpers and the select option docs output.

* fix(database): keep url hrefs working for string and protocol-relative values

Restore hrefs for URL lookup/array cells whose value is a plain string, and
prefix protocol-relative `//` URLs with `https:` instead of `https://`.

Add changelog entry.

* fix: address feedback
2026-07-07 16:30:48 +00:00

35 lines
814 B
Vue

<template>
<div class="array-field__button">
<Button
v-if="isValid(value)"
tag="a"
size="tiny"
type="secondary"
class="forced-pointer-events-auto array-field__button-button"
:href="getHref(value)"
target="_blank"
rel="nofollow noopener noreferrer"
@mousedown.stop
>
<span class=".array-field__ellipsis">{{ getLabelOrURL(value) }}</span>
</Button>
<Button v-else size="tiny" type="secondary" tag="a" disabled>
{{ getLabelOrURL(value) }}
</Button>
</div>
</template>
<script>
import linkURLField from '@baserow/modules/database/mixins/linkURLField'
export default {
name: 'FunctionalFormulaButtonArrayItem',
mixins: [linkURLField],
props: {
value: {
type: Object,
default: null,
},
},
}
</script>