Activation generates unexpected output
-
When installing, there is an unexpected output error if $wpdb->has_cap(‘collation’) is true. This is the result of an undefined variable ($collation). The following block in install.pipes.php lines 35-42 is the issue:
if ( $wpdb->has_cap( 'collation' ) ) { if ( ! empty( $wpdb->charset ) ) { $collation .= "DEFAULT CHARACTER SET $wpdb->charset"; } if ( ! empty( $wpdb->collate ) ) { $collation .= " COLLATE $wpdb->collate"; } }
The problem is that the variable $collation is not defined when you append to it using the concatenating assignment operator “.=”
If debug is turned on (or PHP notices are enabled), this generates an error on activation.
$collation should be declared prior to this block, such as:
$collation = '';
OR, don’t concatenate an undefined variable:
if ( $wpdb->has_cap( 'collation' ) ) { if ( ! empty( $wpdb->charset ) ) { $collation = "DEFAULT CHARACTER SET $wpdb->charset"; } if ( ! empty( $wpdb->collate ) ) { $collation = " COLLATE $wpdb->collate"; } }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Activation generates unexpected output’ is closed to new replies.