]> BookStack Code Mirror - bookstack/commitdiff
Limit short-name for OpenSearch XML to 16 characters
authorMaximilian Walter <redacted>
Sat, 14 Sep 2024 13:31:56 +0000 (15:31 +0200)
committerMaximilian Walter <redacted>
Sat, 14 Sep 2024 13:31:56 +0000 (15:31 +0200)
The specification does not allow more than 16 characters.

resources/views/misc/opensearch.blade.php

index 2b5a6c143f175c466260d96409bcf5899e6f226d..e83e83c12fe7de0789544425fa58a38e71a6f662 100644 (file)
@@ -1,5 +1,5 @@
 <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
-  <ShortName>{{ setting('app-name') }}</ShortName>
+  <ShortName>{{ mb_strimwidth(setting('app-name'), 0, 16) }}</ShortName>
   <Description>Search {{ setting('app-name') }}</Description>
   <Image width="256" height="256" type="image/png">{{ setting('app-icon') ?: url('/icon.png') }}</Image>
   <Image width="180" height="180" type="image/png">{{ setting('app-icon-180') ?: url('/icon-180.png') }}</Image>