Excel export: added a special case to add HYPERLINK Formula when text in the cell matches =HYPERLINK("link","name")

This commit is contained in:
Michael Simpson 2016-11-03 19:51:00 -04:00
parent 70a1c82b32
commit bc8fcf1c02

View File

@ -202,7 +202,7 @@ EOD;
if (CellHelper::isNonEmptyString($cellValue)) { if (CellHelper::isNonEmptyString($cellValue)) {
$matches = array(); $matches = array();
if (preg_match('/=HYPERLINK\("(.*)","(.*)"\)/', $cellValue, $matches)) { if (preg_match('/=HYPERLINK\([\'"](.*)[\'"],\s*[\'"](.*)[\'"]\)/', $cellValue, $matches)) {
// Special case to add HYPERLINK Formula // Special case to add HYPERLINK Formula
$url = $this->stringsEscaper->escape($matches[1]); $url = $this->stringsEscaper->escape($matches[1]);
$text = $this->stringsEscaper->escape($matches[2]); $text = $this->stringsEscaper->escape($matches[2]);