Fix graph display in advanced summary with MSSQL

Graph « Cumulative by date » is not displayed in Summary > Advanced
Summary, SQL Server complains that it cannot convert varchar to int.

Fixes #17011, https://github.com/mantisbt/mantisbt/pull/142

Signed-off-by: Damien Regad <dregad@mantisbt.org>
Set profile to user's default when reporting issues

The default profile was not picked up before this, because the caller
(bug_report_page.php) actually sent '0' as profile id to select, while
the print functions did a strict check for ''.

Fixes #9460

Backport from master 6baf7650fe321a149302c64682f94dbdb2b51b3a
Strip null bytes out of GPC input strings

Backporting commit fc02c46eea9d9e7cc472a7fc1801ea65d467db76 from master
branch to fix issue #17640

Signed-off-by: Damien Regad <dregad@mantisbt.org>