Skip to content

Normalise pre-signed URLs pasted into editors #368 - #758

Open
bwalkerl wants to merge 1 commit into
MOODLE_404_STABLEfrom
368-normalise-signed-urls
Open

Normalise pre-signed URLs pasted into editors #368#758
bwalkerl wants to merge 1 commit into
MOODLE_404_STABLEfrom
368-normalise-signed-urls

Conversation

@bwalkerl

@bwalkerl bwalkerl commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Requires MDL-73596 to be backported to make use of this feature.

Testing instructions:

  1. Setup objectfs and enable pre-signing
  2. Open a pluginfile in a new page, you should see a full pre-signed URL. With this patch it should have a #objectfs-origin= at the end.
  3. Open an editor. This can be mod_label (Text and media area) or anything else.
  4. Copy the URL and paste it into an editor. If this is an image, the image will be shown. If not, you will see the full URL. Hyperlinks can also be tested.
  5. Click save.
  6. Open the editor and confirm that you see a pluginfile link instead. For images, confirm this by viewing the source code in the editor.

This will only work if the link has character encoding for spaces, which should be the default for copying from URL in browser. Chromium will always have the encoded URL, while Firefox will decode the URL but have users copy the encoded URL unless it has been modified. In such edge cases where the URL has been modified (or copied from a different source) the copied value can contain spaces instead of the encoded value, which will break the current handling (it should be obvious in the editor this is broken saving, so I don't think this is the main concern).

Closes #368
Closes #744

@bwalkerl
bwalkerl force-pushed the 368-normalise-signed-urls branch from ca70cf4 to 3e9d576 Compare July 22, 2026 05:39
Comment thread tests/object_file_system_test.php Outdated
Comment thread classes/local/store/object_file_system.php Outdated
Comment thread classes/local/store/object_file_system.php Outdated
Comment thread classes/local/store/object_file_system.php Outdated
Co-authored-by: Srdjan <srdjan@catalyst.net.nz>
@bwalkerl
bwalkerl force-pushed the 368-normalise-signed-urls branch from 3e9d576 to 1d8dec4 Compare July 24, 2026 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rewrite signed urls back to plugin urls on text area saves Re normalize cut and pasted signed urls back into moodle plugin files

2 participants