[wp-trac] [WordPress Trac] #62972: Fatal error in twentyfourteen_paging_nav()

WordPress Trac noreply at wordpress.org
Sun Feb 16 03:34:28 UTC 2025


#62972: Fatal error in twentyfourteen_paging_nav()
--------------------------+-----------------------------
 Reporter:  takayukister  |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Themes        |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 You get the following error when you access the home page with GET
 variables in the array format. Example:
 {{{
 /?test[]=1
 }}}


   Fatal error: Uncaught TypeError: urlencode(): Argument #1 ($string) must
 be of type string, array given in /test/wp-
 content/themes/twentyfourteen/inc/template-tags.php:50 Stack trace: #0
 [internal function]: urlencode(Array) #1 /test/wp-
 content/themes/twentyfourteen/inc/template-tags.php(50):
 array_map('urlencode', Array) #2 /test/wp-
 content/themes/twentyfourteen/index.php(46): twentyfourteen_paging_nav()
 #3 /test/wp-includes/template-loader.php(106):
 include('/Users/miyoshit...') #4 /test/wp-blog-header.php(19):
 require_once('/test...') #5 /test/index.php(17): require('/test...') #6
 {main} thrown in /test/wp-content/themes/twentyfourteen/inc/template-
 tags.php on line 50

 This error occurs because
 [https://core.trac.wordpress.org/browser/tags/6.7.2/src/wp-
 content/themes/twentyfourteen/inc/template-tags.php
 twentyfourteen_paging_nav()] does not expect array variables.

 A possible fix for this would be replacing `array_map( 'urlencode',
 $query_args )` with `urlencode_deep( $query_args )`.

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


More information about the wp-trac mailing list