Fix #13415: cloning issue with attachments doesn't work
Fix Lack of detailed error message during schema creation

During MantisBT installation, when a schema upgrade step includes
several SQL statements (as generated by ADOdb), a detailed error message
was only reported the problem occurs while executing the last statement.

Calling ExecuteSQLArray() with the 2nd param = false forces the function
to return the error message on first failure instead of continuing with
the next statement.

Fixes #14399
Update ADOdb to v5.17 (released 17-May-2012)

Changes vs upstream release[1]:

 - removed following dirs and files:
   contrib/ cute_icons_for_site/ docs/ pear/ tests/ server.php
 - converted CRLF to LF
 - trimmed trailing whitespace

[1] http://phplens.com/lens/lensforum/msgs.php?id=19169

Fixes #13713
ADOdb pgsql fix: AlterColumnSQL conversion from bool to int

When changing type of a column from boolean to integer, PostgreSQL does
not provide implicit type cast, so the library needs to specify it via
USING statement when generating the SQL·

Porting part b) of commit 10871e5afc0bffc546b1a3d60bd7a459fa37e762

This issue exists in ADOdb <= 5.17. Upstream bug report
http://phplens.com/lens/lensforum/msgs.php?id=19204

Fixes #14398
ADOdb pgsql fix: AlterColumnSQL incorrect SQL generated

Fixes behavior on PostgreSQL, where the schema.php upgrade step

$dict->AlterColumnSQL('mantis_user_pref_table', "redirect_delay I
NOTNULL DEFAULT 0" ) );

Generates incorrect SQL:

ALTER TABLE mantis_user_pref_table ALTER COLUMN INTEGER SET NOT NULL
ERROR: column "integer" of relation "mantis_user_pref_table" does not
exist

Porting part a) of commit 10871e5afc0bffc546b1a3d60bd7a459fa37e762

This issue exists in ADOdb <= 5.17. Upstream bug report
http://phplens.com/lens/lensforum/msgs.php?id=19202

Fixes #14398
ADOdb pgsql fix: system warning sprintf(): Too few arguments error

Upstream bug report http://phplens.com/lens/lensforum/msgs.php?id=19186
ADOdb pgsql fix: Allow Quoted Default Values in DataDict

Allows definition of defaults e.g. timestamps

Upstream bug report
http://phplens.com/lens/lensforum/msgs.php?id=17397

Porting commit 156910b5dea81fe234be37695fca926f6490fb9d by Paul Richards

Fixes #14398
Fix install_category_migrate() function for PostgreSQL

With PostgreSQL, the function was throwing a warning due calling
db_query_bound() with mismatched number of parameters to the query.

It was not an issue for other DB's where the parameters are not
positional.
Fix PostgreSQL error when adding project/subproject (schema change)

The error is caused by columns mantis_project_table.inherit_global and
mantis_project_hierarchy_table.inherit_parent, which are defined as
unsigned int in schema.php, but treated as boolean in the code. This is
a problem with PostgreSQL due to strict type checking, but not on MySQL
as type cast is done automatically.

Changes in schema.php the type for the 2 fields project.inherit_global
and project_hierarchy.inherit_parent from Integer to Boolean

Fixes #14385
ADOdb pgsql fix: AlterColumnSQL conversion from int to bool

When changing type of a column from integer to boolean, PostgreSQL does
not provide implicit type cast, so the library needs to specify it via
USING statement when generating the SQL·

Reverse problem of 3fc6200386a975a204f6951acba4067b40ecabd0

This issue exists in ADOdb <= 5.17. Upstream bug report
http://phplens.com/lens/lensforum/msgs.php?id=19204
Fix #14418: Alternate text for logo image is hardcoded
Fix #14420: system warning in make_captcha

Per PHP documentation [1], second param of imagejpeg() should be set to
null to output the image directly.

Thanks to Andrew Kovalenko for noticing and providing fix for the issue

[1] http://php.net/imagejpeg
Fix #11687: use of incorrect error constant
SOAP API: calling mc_issue_update unduly updated bugnotes

History shows 'Note View State changed' even though it has not been
modified, and if time tracking is enabled the bugnote's last_updated
date is changed.

This was caused by a type-strict comparison of the value returned by the
api (string) to an integer.

Fixes #14412
LDAP binding calls are made even if $g_login_method <> LDAP

If for some reason $g_use_ldap_email or $g_use_ldap_realname are ON with
$g_login_method <> 'LDAP', binding calls are attempted when retrieving
the user's e-mail or real name.

Adding a check on $g_login_method to avoid this unwanted behavior.

Fixes #14442
Fix system warning in html_status_legend() with custom status

When using custom status for which no language strings are defined,
html_status_legend() triggered system warnings.

MantisBT now displays the custom status' name as defined in the enum,
in case there is no available translation string.

Fixes #14446
Fix email validation regex rejects addresses with single subdomain

Per RFC 5322, e.g. user@localhost is a valid e-mail address but the
previously implemented regex rejected it.

Fixes #14453
Fix #14448: 'Undefined index: jpg' in '.../core/file_api.php'
Custom field validation should pass when empty and min length > 0

Fix for #12029 (commit dd286bf898f3e9ee330f7c4512cf5ca9437d521e)
introduced a regression in the validation of numeric custom fields when
the field's minimum length is greater than 0 and the data being
validated is empty. This prevents e.g. reporting of new issues with a
hidden custom field, or updating issues having a non-required, empty
field.

This commit resolves the problem by passing validation when the field is
empty. This should not cause problems for required fields, as that case
is covered by an earlier check in bug_report.php and bug_update.php.

Fixes #14516
Fix #14192: Add Exchange header for automessage