Commit d74c0b15 authored by Ahmad Samir's avatar Ahmad Samir Committed by Kurt Hindenburg
Browse files

Fix if condition when updating filters

We want to delete the _escapedUrlFilter if allowEscapedLinks() is false.
parent 11987c7a
......@@ -1304,14 +1304,15 @@ void SessionController::updateFilterList(const Profile::Ptr &profile)
filterChain->addFilter(_urlFilter);
}
const bool allowEscapeSequenceLinks = profile->allowEscapedLinks();
if (allowEscapeSequenceLinks && (_escapedUrlFilter != nullptr)) {
if (profile->allowEscapedLinks()) {
if (_escapedUrlFilter == nullptr) {
_escapedUrlFilter = new EscapeSequenceUrlFilter(_sessionDisplayConnection->session(), _sessionDisplayConnection->view());
filterChain->addFilter(_escapedUrlFilter);
}
} else if (_escapedUrlFilter != nullptr) { // Became disabled, clean up
filterChain->removeFilter(_escapedUrlFilter);
delete _escapedUrlFilter;
_escapedUrlFilter = nullptr;
} else if (allowEscapeSequenceLinks && _escapedUrlFilter == nullptr) {
_escapedUrlFilter = new EscapeSequenceUrlFilter(_sessionDisplayConnection->session(), _sessionDisplayConnection->view());
filterChain->addFilter(_escapedUrlFilter);
}
const bool allowColorFilters = profile->colorFilterEnabled();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment