Update samy.ps1
This commit is contained in:
17
samy.ps1
17
samy.ps1
@@ -756,16 +756,20 @@ if (-not $Global:SamyTasks) {
|
|||||||
function Escape-HtmlAttr {
|
function Escape-HtmlAttr {
|
||||||
param([string]$s)
|
param([string]$s)
|
||||||
if ([string]::IsNullOrEmpty($s)) { return '' }
|
if ([string]::IsNullOrEmpty($s)) { return '' }
|
||||||
$s = $s -replace '&','&'
|
|
||||||
$s = $s -replace '"','"'
|
$s = $s -replace "(`r`n|`r|`n)", ' '
|
||||||
$s = $s -replace '<','<'
|
$s = $s -replace '&','&'
|
||||||
$s = $s -replace '>','>'
|
$s = $s -replace '"','"'
|
||||||
return $s
|
$s = $s -replace "'",'''
|
||||||
|
$s = $s -replace '<','<'
|
||||||
|
$s = $s -replace '>','>'
|
||||||
|
return $s
|
||||||
}
|
}
|
||||||
|
|
||||||
function Escape-HtmlText {
|
function Escape-HtmlText {
|
||||||
param([string]$s)
|
param([string]$s)
|
||||||
if ([string]::IsNullOrEmpty($s)) { return '' }
|
if ([string]::IsNullOrEmpty($s)) { return '' }
|
||||||
|
|
||||||
$s = $s -replace '&','&'
|
$s = $s -replace '&','&'
|
||||||
$s = $s -replace '<','<'
|
$s = $s -replace '<','<'
|
||||||
$s = $s -replace '>','>'
|
$s = $s -replace '>','>'
|
||||||
@@ -792,7 +796,8 @@ if (-not $Global:SamyTasks) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$tooltipText = Escape-HtmlAttr $rawTooltip
|
$tooltipText = Escape-HtmlAttr $rawTooltip
|
||||||
$tooltipAttr = if ([string]::IsNullOrWhiteSpace($tooltipText)) { '' } else { " title=""$tooltipText""" }
|
$tooltipAttr = if ([string]::IsNullOrWhiteSpace($tooltipText)) { '' } else { " title=`"$tooltipText`"" }
|
||||||
|
|
||||||
|
|
||||||
$labelText = Escape-HtmlText ([string]$_.Label)
|
$labelText = Escape-HtmlText ([string]$_.Label)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user