Improving URL sanitation.
This commit is contained in:
parent
a7e72b5d9d
commit
fec102216b
@ -93,7 +93,7 @@ GrafoscopioUtils class >> sanitize: url [
|
|||||||
modUrl := url.
|
modUrl := url.
|
||||||
[modUrl asString endsWith: ' ']
|
[modUrl asString endsWith: ' ']
|
||||||
whileTrue: [ modUrl := modUrl copyFrom: 1 to: (modUrl size - 1) ].
|
whileTrue: [ modUrl := modUrl copyFrom: 1 to: (modUrl size - 1) ].
|
||||||
(url asString beginsWith: 'http://')
|
(url asString beginsWith: 'http') "http or https"
|
||||||
ifFalse: [ sanitized := ('http://', modUrl) asUrl ]
|
ifFalse: [ sanitized := ('http://', modUrl) asUrl ]
|
||||||
ifTrue: [ sanitized := modUrl asUrl ].
|
ifTrue: [ sanitized := modUrl asUrl ].
|
||||||
^ sanitized
|
^ sanitized
|
||||||
|
Loading…
Reference in New Issue
Block a user