Skip to content

Commit

Permalink
Merge pull request #586 from webit-de/20171222_convert-to-string-hook
Browse files Browse the repository at this point in the history
[FEATURE] Add post-processing hook for convertToSafeString method
  • Loading branch information
dmitryd committed Jul 24, 2018
2 parents 719861e + 33476a7 commit 2ebaedd
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Classes/Utility.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,16 @@ public function convertToSafeString($processedTitle, $spaceCharacter = '-', $str
$processedTitle = preg_replace('/' . preg_quote($spaceCharacter) . '{2,}/', $spaceCharacter, $processedTitle);
$processedTitle = trim($processedTitle, $spaceCharacter);

// TODO Post-processing hook here
// Post-processing hook
if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['convertToSafeString_postProc'])) {
foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['convertToSafeString_postProc'] as $userFunc) {
if (is_string($userFunc)) {
$encodingConfiguration = array('strtolower' => $strToLower, 'spaceCharacter' => $spaceCharacter);
$hookParams = array('pObj' => &$this, 'processedTitle' => $processedTitle, 'encodingConfiguration' => $encodingConfiguration);
$processedTitle = GeneralUtility::callUserFunction($userFunc, $hookParams, $this);
}
}
}

if ($strToLower) {
$processedTitle = strtolower($processedTitle);
Expand Down

0 comments on commit 2ebaedd

Please sign in to comment.