Skip to content
Extraits de code Groupes Projets
Valider 239fa980 rédigé par mattab's avatar mattab
Parcourir les fichiers

Page URL are stored with HTML entities encoded (sanitized) fixes #7989

parent 2fd96740
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -38,7 +38,7 @@ class PageUrl
* @static
* @param $originalUrl
* @param $idSite
* @return bool|string
* @return bool|string Returned URL is HTML entities decoded
*/
public static function excludeQueryParametersFromUrl($originalUrl, $idSite)
{
......
......@@ -235,7 +235,7 @@ class TableLogAction
/**
* This function will sanitize or not if it's needed for the specified action type
*
* URLs (Page URLs, Downloads, Outlinks) are stored raw (unsanitized)
* URLs (Download URL, Outlink URL) are stored raw (unsanitized)
* while other action types are stored Sanitized
*
* @param $actionType
......@@ -246,26 +246,25 @@ class TableLogAction
{
$actionString = Common::unsanitizeInputValue($actionString);
if (self::isActionTypeStoredSanitized($actionType)) {
return Common::sanitizeInputValue($actionString);
if (self::isActionTypeStoredUnsanitized($actionType)) {
return $actionString;
}
return $actionString;
return Common::sanitizeInputValue($actionString);
}
/**
* @param $actionType
* @return bool
*/
private static function isActionTypeStoredSanitized($actionType)
private static function isActionTypeStoredUnsanitized($actionType)
{
$actionsTypesStoredUnsanitized = array(
$actionType == Action::TYPE_PAGE_URL,
$actionType == Action::TYPE_DOWNLOAD,
$actionType == Action::TYPE_OUTLINK,
);
$isStoredUnsanitized = in_array($actionType, $actionsTypesStoredUnsanitized);
return !$isStoredUnsanitized;
return in_array($actionType, $actionsTypesStoredUnsanitized);
}
}
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter