From 3cbc65bae4843a4535d1ba538ccbaf5d81e18e07 Mon Sep 17 00:00:00 2001 From: lightbringer Date: Sat, 28 Oct 2017 18:56:16 +1100 Subject: [PATCH] 489: Fix z-index size too big in 64bit OS --- src/PhpWord/Writer/Word2007/Style/Frame.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/PhpWord/Writer/Word2007/Style/Frame.php b/src/PhpWord/Writer/Word2007/Style/Frame.php index 9c6ddaef..abbf07ac 100644 --- a/src/PhpWord/Writer/Word2007/Style/Frame.php +++ b/src/PhpWord/Writer/Word2007/Style/Frame.php @@ -28,6 +28,8 @@ use PhpOffice\PhpWord\Writer\Word2007\Element\ParagraphAlignment; */ class Frame extends AbstractStyle { + const PHP_32BIT_INT_MAX = 2147483647; + /** * Write style. * @@ -41,7 +43,8 @@ class Frame extends AbstractStyle } $xmlWriter = $this->getXmlWriter(); - $zIndices = array(FrameStyle::WRAP_INFRONT => PHP_INT_MAX, FrameStyle::WRAP_BEHIND => -PHP_INT_MAX); + $maxZIndex = min(PHP_INT_MAX, self::PHP_32BIT_INT_MAX); + $zIndices = array(FrameStyle::WRAP_INFRONT => $maxZIndex, FrameStyle::WRAP_BEHIND => -$maxZIndex); $properties = array( 'width' => 'width',