Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
nczirjak-acdh committed Sep 13, 2021
2 parents 704867a + 486aace commit 85d87ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/Helper/FormHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ public function formatCategoryTypes(array $data): array
/*
* Transform the string to remove special chars
*/
private function formatCategoryTitleForValue(string $string): string {
private function formatCategoryTitleForValue(string $string): string
{
$string = str_replace(' ', '-', $string); // Replaces all spaces with hyphens.
return preg_replace('/[^A-Za-z0-9\-]/', '-', $string);
return preg_replace('/[^A-Za-z0-9\-]/', '-', $string);
}
}
10 changes: 4 additions & 6 deletions src/Helper/SearchViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ public function explodeSearchString(): void
}
}

private function checkSearchStringValues(string $arr, string $f) {
private function checkSearchStringValues(string $arr, string $f)
{
if (strpos($arr, $f) !== false) {
$arr = str_replace($f . '=', '', $arr);

Expand Down Expand Up @@ -221,15 +222,15 @@ private function checkSearchStringValues(string $arr, string $f) {
* @param string $data
* @return array
*/
private function explodeCategorySearchStrValues(string $data): array
private function explodeCategorySearchStrValues(string $data): array
{
$result = array();
$values = explode('+', $data);
if (($key = array_search('or', $values)) !== false) {
unset($values[$key]);
}

foreach($values as $v) {
foreach ($values as $v) {
$result[] = ltrim(strstr($v, ':'), ':');
}
return $result;
Expand Down Expand Up @@ -406,7 +407,4 @@ private function setupLang(object &$v)
}
$this->objLang = 'en';
}



}

0 comments on commit 85d87ef

Please sign in to comment.