[wp-trac] [WordPress Trac] #46550: Uncaught TypeError: setcookie() expects parameter 5 to be string, bool given in...

WordPress Trac noreply at wordpress.org
Fri Oct 6 05:21:03 UTC 2023


#46550: Uncaught TypeError: setcookie() expects parameter 5 to be string, bool
given in...
-------------------------------------+-------------------------------------
 Reporter:  kmvan                    |       Owner:  (none)
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  6.4
Component:  Networks and Sites       |     Version:  5.2
 Severity:  minor                    |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:  coding-standards, php-
  has-testing-info                   |  compatibility
-------------------------------------+-------------------------------------
Changes (by oglekler):

 * keywords:  has-patch needs-testing needs-testing-info => has-patch needs-
     testing has-testing-info


Comment:

 For testers:

 {{{
 <?php

  declare( strict_types = 1 ); // Add this to the beginning of the file

  setcookie(
     'name',
     'value',
     time() + YEAR_IN_SECONDS,
     COOKIEPATH,
     COOKIE_DOMAIN
   );
 }}}

 I tried and got the fatal error as described. The patch is solving the
 problem.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46550#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list