nextcloud/forms

Survey not shown on mobile (iOS 15, iPhone < 8)

ilsd opened this issue ยท 6 comments

ilsd commented

Please use the ๐Ÿ‘ reaction to show that you are affected by the same issue. Please don't comment if you have no relevant information to add!

Issue

When sharing a survey created with Forms via a link (anonymous answers) users of mobile browsers (at least on iPhone7, iOS 15.8.2 ) do not see the survey at all.

Other users (e.g. Firefox on Desktop) see and are able to complete the survey (it just works).

Steps to replicate it:

  1. Open this link with a a mobile browser: https://cloud.lantschner.name/index.php/apps/forms/s/YmMTjH4YsPzbjKedEHTNAfAo
  2. See a screen w/o any form

IMG_7612

Sumary

All users of iPhone < 8 can not participate in any survey.

Seems the problem is the lookbehind, which is only supported starting iOS 16.4 (Lookbehind in JS regular expressions | Can I use... Support tables for HTML5, CSS3, etc 1)

TODO: It needs to be checked if the current regex can be rewritten without a lookbehind.

Discussion

https://help.nextcloud.com/t/forms-survey-not-shown-at-all-on-mobile-ios-if-shared-via-link/186261

May be related to

https://help.nextcloud.com/t/forms-nextcloud-app-gui-fehler/166702
sounds similar although, in their case, the user was obviously at least able to start the survey.

Context

Nextcloud version : Nextcloud Hub 7 (28.0.3)
Operating system and version: Debian 4.19.304-1
Apache or nginx version : Apache/2.4.38 (Debian)
PHP version: PHP 8.2.17

@susnux following the investigation in the forum I think it comes from this line here: https://github.com/nextcloud/forms/blob/main/src%2Futils%2FRegularExpression.js#L30

Is there an easy fix for it? If not I think that we shouldn't set this on highest priority given that the devices only receive security fixes from Apple and all modern browsers support this code.

I think we could use (?:^|[^\\])(?:\\\\)*\/ as a regex, it only matches for non escaped slashes, so for checking it works.

So you mean that in our case it doesn't matter if it also matches preceeding characters? If yes, fine for me. Should I create a PR for that or do you want to do it yourself?

Yes we do not care, as we just use it for testing not sanitizing. If you want create a PR, happy to review :)