Theming - Slogan encoding issue

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 12.0.2): 15.0.4
Operating system and version (eg, Ubuntu 17.04): Ubuntu 18.04
Apache or nginx version (eg, Apache 2.4.25): Apache2 2.4.29
PHP version (eg, 7.1): PHP 7.2.15-0ubuntu0.18.04.1
Browser: Chrome on Windows Version 72.0.3626.109 (Official Build) (64-bit)

The issue you are facing:
Entering an apostrophe character in the “slogan” theming dialog renders a character code in the About box instead of the character.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Enter an apostrophe in the slogan box : “Myco’s filing cabinet”
    image
  2. Open the About box
    image

If you want any of the further config/logs, let me know.

MariaDB [nextcloud]> select * from oc_appconfig where appid="theming" AND configkey="slogan";
+---------+-----------+------------------------+
| appid   | configkey | configvalue            |
+---------+-----------+------------------------+
| theming | slogan    | Newco's filing cabinet |
+---------+-----------+------------------------+
1 row in set (0.00 sec)

The slogan is stored in the database table oc_appconfig, appid = “theming”, configkey = “slogan”.
You should have a look how it is stored there.

It looks OK in there. I guess the issue is on the rendering side. It’s also messed up when I go back to the Settings page to edit. Maybe the read from the database isn’t handling it nicely.

Try to escape the ’ => \’ in the database table.

I can confirm this issue when using double-quotes in the slogan.
They are shown as " on the about dialog, but on the login page everything is fine.

Nextcloud Version: 15.0.4
PHP: 7.2.14
MySQL: 5.7.23

Using a single \ makes no difference. in the database
Using triple \ gives me a slash on the displayed output in addition to the 'and a single slash in the database.

MariaDB [nextcloud]> update oc_appconfig SET configvalue="Newco\'s filing cabinet" where oc_appconfig.appid="theming" AND oc_appconfig.configkey="slogan";
Query OK, 0 rows affected (0.01 sec)
Rows matched: 1  Changed: 0  Warnings: 0

MariaDB [nextcloud]> select * from oc_appconfig where appid="theming" AND configkey="slogan";
+---------+-----------+------------------------+
| appid   | configkey | configvalue            |
+---------+-----------+------------------------+
| theming | slogan    | Newco's filing cabinet |
+---------+-----------+------------------------+
1 row in set (0.00 sec)

MariaDB [nextcloud]> update oc_appconfig SET configvalue="Newco\\\'s filing cabinet" where oc_appconfig.appid="theming" AND oc_appconfig.configkey="slogan";
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

MariaDB [nextcloud]> select * from oc_appconfig where appid="theming" AND configkey="slogan";
+---------+-----------+-------------------------+
| appid   | configkey | configvalue             |
+---------+-----------+-------------------------+
| theming | slogan    | Newco\'s filing cabinet |
+---------+-----------+-------------------------+
1 row in set (0.00 sec)

MariaDB [nextcloud]>

You may try a double backslash too but I fear it’s a problem with the Nextcloud-code, which handles such cases seemingly incorrectly.

That’s my guess too, I will create an issue when I’m back at my PC.

1 Like

There already was an issue about this misbehaviour: