Skip to content

Commit

Permalink
Fixes #92 - PHP Notice: Array to string conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
arunbasillal committed Jan 20, 2019
1 parent 05ef8b3 commit 64826e8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions admin/basic-setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,18 +401,22 @@ function superpwa_add_rewrite_rules() {
* Generates SW and Manifest on the fly.
*
* This way no physical files have to be placed on WP root folder. Hallelujah!
*
* @since 2.0
*
* @author Maria Daniel Deepak <daniel@danieldeepak.com>
*
* @uses superpwa_get_sw_filename()
* @uses superpwa_get_manifest_filename()
* @uses superpwa_get_manifest()
* @uses superpwa_manifest_template()
* @uses superpwa_sw_template()
*
* @since 2.0
* @since 2.1 uses http_build_query() instead of implode() to convert query_vars to string.
*/
function superpwa_generate_sw_and_manifest_on_fly( $query ) {
if ( ! property_exists( $query, 'query_vars' ) || ! is_array( $query->query_vars ) ) {
return;
}
$query_vars_as_string = implode( ',', $query->query_vars );
$query_vars_as_string = http_build_query( $query->query_vars );
$manifest_filename = superpwa_get_manifest_filename();
$sw_filename = superpwa_get_sw_filename();

Expand Down

0 comments on commit 64826e8

Please sign in to comment.