mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-21 14:47:31 +09:00
Issue #910 part 2. Strip ':' and anything following it from the string passed to the location.protocol setter.
This commit is contained in:
parent
32eb361301
commit
a6eab2d84e
1 changed files with 8 additions and 1 deletions
|
|
@ -33,6 +33,7 @@
|
||||||
#include "nsCycleCollectionParticipant.h"
|
#include "nsCycleCollectionParticipant.h"
|
||||||
#include "nsNullPrincipal.h"
|
#include "nsNullPrincipal.h"
|
||||||
#include "ScriptSettings.h"
|
#include "ScriptSettings.h"
|
||||||
|
#include "mozilla/Unused.h"
|
||||||
#include "mozilla/dom/LocationBinding.h"
|
#include "mozilla/dom/LocationBinding.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
@ -716,7 +717,13 @@ Location::SetProtocol(const nsAString& aProtocol)
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
rv = uri->SetScheme(NS_ConvertUTF16toUTF8(aProtocol));
|
nsAString::const_iterator start, end;
|
||||||
|
aProtocol.BeginReading(start);
|
||||||
|
aProtocol.EndReading(end);
|
||||||
|
nsAString::const_iterator iter(start);
|
||||||
|
Unused << FindCharInReadable(':', iter, end);
|
||||||
|
|
||||||
|
rv = uri->SetScheme(NS_ConvertUTF16toUTF8(Substring(start, iter)));
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue