Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: clicking a hyperlink in a document opens in both the current tab and a new tab for users who can't edit the file #4395

Open
5 of 8 tasks
mig5 opened this issue Jun 26, 2023 · 3 comments
Assignees
Labels
0. Needs triage bug Something isn't working

Comments

@mig5
Copy link

mig5 commented Jun 26, 2023

⚠️ This issue respects the following points: ⚠️

Bug description

When a user opens a file (tested with markdown .md file, but possibly .odt as well) that's been shared with them, but which they don't have edit permissions for, and they left-click a hyperlink in that file, the link opens in both a new tab and the existing Nextcloud tab, simultaneously.

This does not occur if the user has 'edit' rights to the document. In this scenario, the link only opens in a new tab, as expected.

Steps to reproduce

  1. Create a markdown file and put a hyperlink in it (e.g a link to this Github issue)
  2. Share the file with another Nextcloud user, but don't give them edit rights to the file
  3. Left-click the link in the file as that other Nextcloud user - link opens in 2 tabs (one new tab, and the existing Nextcloud tab)
  4. Grant that Nextcloud user 'edit' rights to the file
  5. Open the file in Nextcloud again as that user and left-click the same link - link opens in just one new tab

Expected behavior

The link should only open in a new tab, regardless of edit or no-edit permission for that user

Installation method

Community Docker image

Nextcloud Server version

25

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

Apache (supported)

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

Encryption is Enabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "mail_smtpmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpsecure": "ssl",
        "mail_smtpauth": true,
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "nextcloud.xxxxx.xxx"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "25.0.8.2",
        "overwrite.cli.url": "https:\/\/nextcloud.xxxxx.xxx",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "overwritehost": "nextcloud.xxxxx.xxx",
        "overwriteprotocol": "https",
        "loglevel": 2,
        "maintenance": false,
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [],
        "twofactor_enforced_excluded_groups": []
    }
}

List of activated Apps

Enabled:
  - activity: 2.17.0
  - bruteforcesettings: 2.5.0
  - circles: 25.0.0
  - cloud_federation_api: 1.8.0
  - comments: 1.15.0
  - contactsinteraction: 1.6.0
  - dashboard: 7.5.0
  - dav: 1.24.0
  - encryption: 2.13.0
  - federatedfilesharing: 1.15.0
  - federation: 1.15.0
  - files: 1.20.1
  - files_pdfviewer: 2.6.0
  - files_rightclick: 1.4.0
  - files_sharing: 1.17.0
  - files_trashbin: 1.15.0
  - files_versions: 1.18.0
  - firstrunwizard: 2.14.0
  - integration_github: 1.0.15
  - logreader: 2.10.0
  - lookup_server_connector: 1.13.0
  - nextcloud_announcements: 1.14.0
  - notifications: 2.13.1
  - oauth2: 1.13.1
  - password_policy: 1.15.0
  - photos: 2.0.1
  - polls: 5.0.5
  - privacy: 1.9.0
  - provisioning_api: 1.15.0
  - recommendations: 1.4.0
  - related_resources: 1.0.4
  - richdocuments: 7.1.4
  - serverinfo: 1.15.0
  - settings: 1.7.0
  - sharebymail: 1.15.0
  - support: 1.8.0
  - survey_client: 1.13.0
  - systemtags: 1.15.0
  - text: 3.6.0
  - theming: 2.0.1
  - twofactor_backupcodes: 1.14.0
  - twofactor_totp: 7.0.0
  - twofactor_webauthn: 1.2.0
  - updatenotification: 1.15.0
  - user_status: 1.5.0
  - viewer: 1.9.0
  - weather_status: 1.5.0
  - workflowengine: 2.7.0
Disabled:
  - admin_audit
  - files_external
  - notify_push: 0.6.3
  - suspicious_login
  - user_ldap

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

No response

Additional info

No response

@mig5 mig5 added 0. Needs triage bug Something isn't working labels Jun 26, 2023
@mig5
Copy link
Author

mig5 commented Jun 26, 2023

Looks to be reported on the forum at https://help.nextcloud.com/t/links-in-text-files-will-open-2x/149729/9 - but I went ahead and reported it here since someone asked the OP there to file a Github issue (and not clear that they ever did)

@szaimen szaimen transferred this issue from nextcloud/server Jun 26, 2023
@mig5
Copy link
Author

mig5 commented Jun 27, 2023

(thanks for transferring the issue to the right repository, my apologies). Now that it's in the 'text' repo, I searched the issue queue here and I found that #579 (comment) is exactly the same issue/symptom described.

The only problem is, it's claimed to have been fixed there, around Oct 2022... but it's definitely a problem in the latest Nextcloud 25.0.8, so, perhaps it's a regression?

@joshtrichards
Copy link
Member

The only problem is, it's claimed to have been fixed there, around Oct 2022... but it's definitely a problem in the latest Nextcloud 25.0.8, so, perhaps it's a regression?

#3290 (the fix for #579) was only released for >=v26 from the looks of it.

@joshtrichards joshtrichards self-assigned this Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants