[wp-trac] [WordPress Trac] #47199: Cant post or edit comments from admin page when removing css/js query string

WordPress Trac noreply at wordpress.org
Thu May 9 11:04:17 UTC 2019


#47199: Cant post or edit comments from admin page when removing css/js query
string
--------------------------+-----------------------------
 Reporter:  Stolle7       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Comments      |    Version:  5.2
 Severity:  major         |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 After updating to version 5.2 I was unable to either post or edit comments
 from the admin page. I disabled all plugins without any help, and then
 started doing trial-and-error by deleting parts of my functions.php
 (customized) one by one.

 I isolated the problem to the following, quite commonly used php snippet
 to remove css and js versions from the files. When having this enabled,
 it's not possible to either post or edit comments.

 Code:

 {{{#!php
 <?php
 function remove_cssjs_ver( $src ) {
   if( strpos( $src, '?ver=' )){
     $src = remove_query_arg( 'ver', $src );
                  }
     return $src;
   }

 add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );

 }}}


 Information about my site:
 - WordPress version 5.2
 - Php 7.1
 - Theme: Child theme of "Accesspress Lite"

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47199>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list