Skip to content

Commit

Permalink
fix: just need to trim backslash
Browse files Browse the repository at this point in the history
  • Loading branch information
MissAllSunday committed Dec 26, 2024
1 parent 9797a8b commit d538dd6
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions Sources/ManageMaintenance.php
Original file line number Diff line number Diff line change
Expand Up @@ -2109,7 +2109,7 @@ function get_integration_hooks_data($start, $per_page, $sort, $filtered_hooks, $
foreach ($filtered_hooks as $hook => $functions)
foreach ($functions as $rawFunc)
{
$hookParsedData = parse_integration_hook($hook, $rawFunc, $function_list);
$hookParsedData = parse_integration_hook($hook, $rawFunc);

// Handle hooks pointing outside the sources directory.
$absPath_clean = rtrim($hookParsedData['absPath'], '!');
Expand Down Expand Up @@ -2168,10 +2168,9 @@ function get_integration_hooks()
*
* @param string $hook
* @param string $rawData A string as it was saved to the DB.
* @param array $functionList A list of functions found on previously parsed files
* @return array everything found in the string itself
*/
function parse_integration_hook(string $hook, string $rawData, array $functionList)
function parse_integration_hook(string $hook, string $rawData)
{
global $boarddir, $settings, $sourcedir;

Expand Down Expand Up @@ -2231,16 +2230,6 @@ function parse_integration_hook(string $hook, string $rawData, array $functionLi

$hookData['call'] = ltrim($hookData['call'], '\\');

// One last chance, perhaps the file was included in another way
if ($hookData['absPath'] === '' && isset($functionList[$hookData['call']]))
{
$hookData['absPath'] = strtr(strtr(trim($functionList[$hookData['call']]), [
'$boarddir' => $boarddir,
'$sourcedir' => $sourcedir,
'$themedir' => $settings['theme_dir'] ?? ''
]), '\\', '/');
}

return $hookData;
}

Expand Down

0 comments on commit d538dd6

Please sign in to comment.