Problems with Plugin “TablePress”
-
Tested on:
- WordPress 6.1.1
- plugin load filter 4.0.12 (and older versions)
- TablePress 2.0 (and older versions)
problem description:
you can not insert images into table cells because plugin load filter interferes in the ajax call. If you deactivate plugin load filter, it works fine.
Steps to reproduce:
- install Plugin “TablePress” by Author Tobias B?thge
- install Plugin “plugin load filter”
- In admin menu click on “TablePress”
- Create a new table
- Right Click on a table cell and choose “Insert Image” or click on the “Insert Image” button below the table.
- The image does not get inserted throwing an PHP Error
PHP Fatal error: Uncaught TypeError: urlencode(): Argument #1 ($string) must be of type string, array given
The problem is triggered in mu-plugins/plf-filter.php on line 1002
$GLOBALS['wp']->query_posts();
which calls wp_basename() with $path as an argument which contains an array at this point, which is not right. It should be a string and not an array. It then calls urlencode() which throws the error.
If you print out the $_POST variable for the ajax request it contains something like that:
Array ( [nonce] => f8a54e0db5 [attachment] => Array ( [id] => 769070 [post_content] => [post_excerpt] => [align] => right [image-size] => full ) [html] => <img src="" width="2400" height="1800" alt="" class="wp-image-769070 alignright size-full" /> [post_id] => 0 [action] => send-attachment-to-editor )
Since i cant hook into your plugin because it loads first as a mu-plugin I can′t change this behavior.
My current workaround is:
if ($_POST['action'] === 'send-attachment-to-editor') { return false; }
somewhere above line 1002 in mu-plugins/plf-filter.php
Thank you very much for your help.
- The topic ‘Problems with Plugin “TablePress”’ is closed to new replies.