oox/source/helper/attributelist.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
New commits: commit d7f969a133d4eb8258b5d90ed88532cfcdbc9b28 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sun Dec 11 16:42:37 2022 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sun Dec 11 19:26:08 2022 +0000 crashtesting: accept timestamp with Z suffix as valid seen with forum-mso-en4-652977.xlsx Change-Id: I5ca7be851c279d28e225cba1ba401a4f7fa99e87 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143944 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/oox/source/helper/attributelist.cxx b/oox/source/helper/attributelist.cxx index d61f3bb2bf44..e950ee5ea490 100644 --- a/oox/source/helper/attributelist.cxx +++ b/oox/source/helper/attributelist.cxx @@ -258,8 +258,9 @@ std::optional< util::DateTime > AttributeList::getDateTime( sal_Int32 nAttrToken { std::string_view aValue = getView( nAttrToken ); util::DateTime aDateTime; - bool bValid = (aValue.size() == 19) && (aValue[ 4 ] == '-') && (aValue[ 7 ] == '-') && - (aValue[ 10 ] == 'T') && (aValue[ 13 ] == ':') && (aValue[ 16 ] == ':'); + bool bValid = (aValue.size() == 19 || (aValue.size() == 20 && aValue[19] == 'Z')) && + (aValue[ 4 ] == '-') && (aValue[ 7 ] == '-') && (aValue[ 10 ] == 'T') && + (aValue[ 13 ] == ':') && (aValue[ 16 ] == ':'); if (!bValid) return std::optional< util::DateTime >(); aDateTime.Year = static_cast< sal_uInt16 >( o3tl::toInt32(aValue.substr( 0, 4 )) );