Support » Plugin: Contact Form 7 » Compatibility issue with Duplicate Post plugin

  • chesio

    (@chesio)


    Hi Takayuki,

    I have a small bugfix request. I have a website with both Contact Form 7 and Duplicate Post plugin installed and every time I visit Contact Forms page in backend, I got PHP notices in debug log generated by Duplicate Post.

    I digged into Duplicate Post code and found out that the notices are triggered, because $_GET['post'] is set, but is empty in the same time. I wondered how is that even possible, because there is no post= argument in query string of backend URL. Then I found out that Contact Form 7 manipulates $_GET array and insert this key – in current version (5.1.1) of Contact Form 7, this happens at line 325 in admin/admin.php:

    $_GET['post'] = isset( $_GET['post'] ) ? $_GET['post'] : '';
    

    As a developer myself, I consider adding new items to $_GET array programmaticaly a bad practice, therefore I’m kindly asking you, not Enrico Battocchi (Duplicate Post author), to fix it. As far as I have seen related Contact Form 7 code, the assignment to $_GET['post'] can be easily avoided.

    I believe by fixing this, you will improve compatibility not only with Duplicate Post but potentially more plugins that expect $_GET['post'] to be non-empty if present.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.