Support » Plugin: BuddyPress Global Search » PHP Notice on array URL query args (solution included)

  • When building the pagination links in the function emi_generate_paging_param in includes/functions.php:254, your plugin adds the $_GET parameters to the new url. If there is an array in $_GET this line: $base_link .= "$k=$v&"; produces a PHP Notice Array to string conversion.

    As a solution you could change the line to: $base_link .= http_build_query( array( $k => $v ) ) . '&';

Viewing 1 replies (of 1 total)
  • Thread Starter wordpressrene

    (@wordpressrene)

    I found another even better solution:
    Instead of

    foreach ($_GET as $k => $v) {
    	$base_link .= "$k=$v&";
    }

    you can just write
    $base_link .= http_build_query( $_GET );

Viewing 1 replies (of 1 total)
  • The topic ‘PHP Notice on array URL query args (solution included)’ is closed to new replies.