Skip to content

Commit

Permalink
Fix php notice : php end function requires a reference
Browse files Browse the repository at this point in the history
"PHP Notice:  Only variables should be passed by reference in /var/www/esup-wayf/functions.php on line 287"
https://stackoverflow.com/questions/4636166/only-variables-should-be-passed-by-reference
  • Loading branch information
vbonamy authored and prigaux committed Feb 6, 2024
1 parent 0818acc commit e1a2023
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,9 @@ function getDomainNameFromURI($string){
// Check if string is URN
if (preg_match('/^urn:mace:/i', $string)){
// Return last component of URN
return getTopLevelDomain(end(explode(':', $string)));
$expl_string = explode(':', $string);
$end_expl_string = end($expl_string);
return getTopLevelDomain($end_expl_string);
}

// Apparently we are dealing with something like a URL
Expand Down

0 comments on commit e1a2023

Please sign in to comment.