# Oneboxing modifica l'URL del link?

**URL:** https://meta.discourse.org/t/oneboxing-changes-link-url/182545
**Category:** Support
**Created:** [8 Marzo 2021, 8:10pm UTC](https://meta.discourse.org/t/oneboxing-changes-link-url/182545 "2021-03-08T20:10:59Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Tom\_Eagle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tom_eagle/32/200481_2.png) [@Tom\_Eagle](https://meta.discourse.org/u/Tom_Eagle)
#### Post date: [8 Marzo 2021, 8:10pm UTC](https://meta.discourse.org/t/oneboxing-changes-link-url/182545/1 "2021-03-08T20:10:59Z")

</div>

Ciao a tutti,

Nel nostro forum c’è un problema: quando un URL viene “oneboxed”, viene modificato l’URL stesso.

Ad esempio:

Questo è un link al nostro sito web:  
[https://www.morphmarket.com/c/reptiles/pythons/ball-pythons/genetic-calculator/?s1=Pastel%2CHet+Clown&s2=Pastel%2CHet+Clown](https://www.morphmarket.com/c/reptiles/pythons/ball-pythons/genetic-calculator/?s1=Pastel%2CHet+Clown&s2=Pastel%2CHet+Clown)

Ma questo è ciò che appare quando viene oneboxed:  
[https://www.morphmarket.com/c/reptiles/pythons/ball-pythons/genetic-calculator/?s1=Pastel,Het%2BClown&s2=Pastel,Het%2BClown](https://www.morphmarket.com/c/reptiles/pythons/ball-pythons/genetic-calculator/?s1=Pastel,Het%2BClown&s2=Pastel,Het%2BClown)

Con:

- “%2C” trasformato in “,”.
- “+” trasformato in “%2B”.

Ciò restituisce agli utenti risultati errati sul nostro sito.

Esiste un modo per evitare che ciò accada o una soluzione alternativa?

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [8 Marzo 2021, 8:19pm UTC](https://meta.discourse.org/t/oneboxing-changes-link-url/182545/2 "2021-03-08T20:19:04Z")

</div>

Quei link sono entrambi uguali:

`https://www.morphmarket.com/c/reptiles/pythons/ball-pythons/genetic-calculator/?s1=Pastel,Het%2BClown&s2=Pastel,Het%2BClown`

Puoi racchiuderli tra backtick così possiamo vederli come intendevi?

---

<div class="post-metadata">

### Author: ![Tom\_Eagle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tom_eagle/32/200481_2.png) [@Tom\_Eagle](https://meta.discourse.org/u/Tom_Eagle)
#### Post date: [8 Marzo 2021, 8:58pm UTC](https://meta.discourse.org/t/oneboxing-changes-link-url/182545/3 "2021-03-08T20:58:56Z")

</div>

Scusa, è stata una mia svista 🙄

Questo è come dovrebbe apparire:

```
https://www.morphmarket.com/c/reptiles/pythons/ball-pythons/genetic-calculator/?s1=Pastel%2CHet+Clown&s2=Pastel%2CHet+Clown

```

Questo è ciò che succede quando viene messo in un solo riquadro:

```
https://www.morphmarket.com/c/reptiles/pythons/ball-pythons/genetic-calculator/?s1=Pastel,Het%2BClown&s2=Pastel,Het%2BClown

```

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [9 Marzo 2021, 9:30am UTC](https://meta.discourse.org/t/oneboxing-changes-link-url/182545/4 "2021-03-09T09:30:14Z")

</div>

Se l’URL è funzionante in entrambi i casi, perché dovrebbe importare?

---

<div class="post-metadata">

### Author: ![Tom\_Eagle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tom_eagle/32/200481_2.png) [@Tom\_Eagle](https://meta.discourse.org/u/Tom_Eagle)
#### Post date: [9 Marzo 2021, 11:25am UTC](https://meta.discourse.org/t/oneboxing-changes-link-url/182545/5 "2021-03-09T11:25:27Z")

</div>

Perché portano a risultati diversi.

Ecco cosa dovrebbe essere mostrato tramite il link:

 ![SmartSelect_20210309-112213_Chrome](https://global.discourse-cdn.com/meta/original/3X/2/a/2a4864bf93f54b23b15d8cf9d53d6cf9261bb008.jpeg)

Non questo:

 ![SmartSelect_20210309-112241_Chrome](https://global.discourse-cdn.com/meta/original/3X/e/6/e670b6fb8818406548ed6e1edb9ae1859340cf8f.jpeg)

Questo fa una grande differenza quando si cerca di calcolare correttamente la genetica.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [24 Luglio 2023, 11:59am UTC](https://meta.discourse.org/t/oneboxing-changes-link-url/182545/9 "2023-07-24T11:59:58Z")

</div>

Sembra che gli URL nell’OP non siano più “oneboxable” (nessun tag opengraph sul sito). Ma solo per la cronaca, questo problema dovrebbe essere stato risolto da

> <https://github.com/discourse/discourse/commit/f0a02525267e88986581be1f87c9e5608b9a4377>
>
> normalized\_encode in addressable has a number of issues, including https://githu…b.com/sporkmonger/addressable/issues/472
> 
> To temporaily work around those issues for the majority of cases, we try parsing with \`::URI\`. If that fails (e.g. due to non-ascii characters) then we will fall back to addressable.
> 
> Hopefully we can simplify this back to \`Addressable::URI.normalized\_encode\` in the future.
> 
> This commit also adds support for unicode domain names and emoji domain names with escape\_uri.
> 
> This removes an unneeded hack checking for pre-signed urls, which are now handled by the general case due to starting off valid and only being minimally normalized. Previous test case continues to pass.
> 
> UrlHelper.s3\_presigned\_url? which was somewhat wide was removed.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [23 Agosto 2023, 12:00pm UTC](https://meta.discourse.org/t/oneboxing-changes-link-url/182545/10 "2023-08-23T12:00:23Z")

</div>

Questo argomento è stato chiuso automaticamente 30 giorni dopo l’ultima risposta. Non sono più consentite nuove risposte.
