Disabled pasting images directly into text

Submitted by Admin on Thu, 09/01/2022 - 18:41

The preferred way to add a photo to text on Gwulo is to upload it first, then use the "Insert from Media Library" button in the editor.

But over the years, contributors have occasionally just copied a photo from their PC / Mac / etc., and pasted it directly into the text. That causes problems on the upgraded site. If you visit a page where a photo was pasted into the text, you just get a long list of error messages, starting:

TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in _filter_url() 

If you spot a page that shows this error message, please leave a comment below with a link to that page. Then I'll delete the pasted image and replace it with the text: PASTED IMAGE DELETED

To stop it happening in future, I've updated the editor so that if you try pasting an image you'll see a popup with the error message: "Direct image paste is not allowed".