Skip to content

Commit

Permalink
php 5.3 compatible code
Browse files Browse the repository at this point in the history
  • Loading branch information
troosan committed Feb 10, 2021
1 parent 4840faa commit 81d613b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/PhpWord/Shared/Html.php
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,8 @@ protected static function parseStyle($attribute, $styles)
// Word does not accept shortened hex colors e.g. #CCC, only full e.g. #CCCCCC
if (preg_match('/([0-9]+[^0-9]*)\s+(\#[a-fA-F0-9]+|[a-zA-Z]+)\s+([a-z]+)/', $cValue, $matches)) {
if (false !== strpos($cKey, '-')) {
$which = explode('-', $cKey)[1];
$tmp = explode('-', $cKey);
$which = $tmp[1];
$which = ucfirst($which); // e.g. bottom -> Bottom
} else {
$which = '';
Expand Down

0 comments on commit 81d613b

Please sign in to comment.