Links in table changed on save
-
Hi Tobias,
This is a weird one. I’m using Amazon S3 offload for media storage, so after a file is uploaded to WordPress, the offload plugin sends it up to S3 and changes the URL to be the one on Amazon.
https://example.com/wp-content/uploads/2019/09/image.jpg
https://uploads.example.com/wp-content/uploads/2019/09/12345678/image.jpg
The subdomain points to my S3 storage and Amazon adds an 8-digit ID to the URL
I’ve been doing this for a long time now and it works fine throughout the site for media storage.Now the problem:
I upload a PDF file to the media library and gets its URL. I then edit a table and paste a link to the PDF into a table cell using the advanced editor. If I preview the table I can see that the link is correct. Now I save the table and it still looks correct in the table editor, but if I view the page which displays the table, or if I refresh the TablePress page then I can see that the URL has been changed on save to the original URL before it was offloaded to S3. The rest of the cell content is fine, only the URL gets changed. It doesn’t make any difference whether the URL is part of an HTML A tag or just plain text. It seems there is some sanitizing going on somewhere which changes the link from the one I entered. Even the TablePress frontend doesn’t know about this because it doesn’t show that change on save, only when you reload the table from the DB.For reference, if I create a link directly in a page or post then it works fine as expected. Only in TablePress do I see this.
- The topic ‘Links in table changed on save’ is closed to new replies.