# Leading/trailing spaces cause errors when importing themes

**URL:** https://meta.discourse.org/t/leading-trailing-spaces-cause-errors-when-importing-themes/104138
**Category:** Bug
**Created:** [12 december 2018 om 19:09 UTC](https://meta.discourse.org/t/leading-trailing-spaces-cause-errors-when-importing-themes/104138 "2018-12-12T19:09:45Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [12 december 2018 om 19:09 UTC](https://meta.discourse.org/t/leading-trailing-spaces-cause-errors-when-importing-themes/104138/1 "2018-12-12T19:09:45Z")

</div>

We do not strip leading or trailing spaces when importing a theme or theme component from the web. A 500 error is generated, which does not provide the user details on how to resolve the issue.

We should strip leading/trailing spaces when attempting to import themes, or provide a useful error message to the user.

---

<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: [13 december 2018 om 00:09 UTC](https://meta.discourse.org/t/leading-trailing-spaces-cause-errors-when-importing-themes/104138/2 "2018-12-13T00:09:56Z")

</div>

Yes, who can this be assigned to @sam?

---

<div class="post-metadata">

### Author: ![nbianca](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nbianca/32/157984_2.png) [@nbianca](https://meta.discourse.org/u/nbianca)
#### Post date: [13 december 2018 om 12:18 UTC](https://meta.discourse.org/t/leading-trailing-spaces-cause-errors-when-importing-themes/104138/4 "2018-12-13T12:18:43Z")

</div>

Fixed by

[https://github.com/discourse/discourse/pull/6762](https://github.com/discourse/discourse/pull/6762)

---

<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: [13 december 2018 om 22:41 UTC](https://meta.discourse.org/t/leading-trailing-spaces-cause-errors-when-importing-themes/104138/5 "2018-12-13T22:41:54Z")

</div>


