fix: Trim strings of brackets before running the freetext detection on them

pull/1709/head
Iglocska 2016-12-01 12:24:42 +01:00
parent 053b0453cb
commit 576d58462d
1 changed files with 4 additions and 2 deletions

View File

@ -123,6 +123,7 @@ class ComplexTypeTool {
}
public function checkFreeText($input, $settings = array()) {
$charactersToTrim = array('\'', '"', ',', '(', ')');
$iocArray = preg_split("/\r\n|\n|\r|\s|\s+|,|;/", $input);
$quotedText = explode('"', $input);
foreach ($quotedText as $k => $temp) {
@ -138,8 +139,9 @@ class ComplexTypeTool {
if (!empty($iocArray)) {
foreach ($iocArray as $ioc) {
$ioc = trim($ioc);
$ioc = trim($ioc, '"');
$ioc = trim($ioc, ',');
foreach ($charactersToTrim as $c) {
$ioc = trim($ioc, $c);
}
$ioc = preg_replace('/\p{C}+/u', '', $ioc);
if (empty($ioc)) continue;
$typeArray = $this->__resolveType($ioc);