Skip to content

Commit

Permalink
Upgrade unattended: don't output html
Browse files Browse the repository at this point in the history
Since the script is meant to be run on command-line, and considering
that even if we run it in the browser we set Content-Type: text/plain it
makes no sense to output <br />.

I replaced it with a "\n", printed only if the DB error message is not
empty.
  • Loading branch information
dregad committed Mar 14, 2015
1 parent 662e3fb commit d04d51a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion admin/upgrade_unattended.php
Expand Up @@ -177,7 +177,11 @@ function print_test_result( $p_result, $p_hard_fail = true, $p_message = '' ) {
print_test_result( GOOD );
config_set( 'database_version', $i );
} else {
print_test_result( BAD, true, $t_sqlarray[0] . '<br />' . $g_db->ErrorMsg() );
$t_msg = $t_sqlarray[0];
if( !is_blank( $g_db->ErrorMsg() ) ) {
$t_msg .= "\n" . $g_db->ErrorMsg();
}
print_test_result( BAD, true, $t_msg );
}

$i++;
Expand Down

0 comments on commit d04d51a

Please sign in to comment.