-
Notifications
You must be signed in to change notification settings - Fork 1.5k
skip checking pdf after it has been checked and marked safe. #18541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 11.5
Are you sure you want to change the base?
Conversation
Review Checklist
|
|
|
Didn't look in detail, but what happens if a new version of the PDF is uploaded? Is it checked again in that case? |
|
I don't know, that is a good question. That said, if the value is not cleared out / reset on a new upload, then there is a bug now: the flag will show "safe" until this upload handler is run and there is no guarantee if / when it will run. |
|
This is now just speculation: but if on upload (or save) |
Agreed, and this PR might be "bad". My only point above was that |
|
that is a good point 👍 |
|
What would be the best way to clear the scan status upon a new upload? Lines 595 to 599 in 83a8866
e.g.: if ($this->getDataChanged()) {
if ($this->getType() === 'document') {
$this->setCustomSetting(
self::CUSTOM_SETTING_PDF_SCAN_STATUS,
null
);
}
if (in_array($this->getType(), ['image', 'video', 'document'])) {
$this->addToUpdateTaskQueue();
}
} |
@cancan101 Unfortunately that doesn't work, because in |
|
You could also call // check here for updateScanStatus
if ($this->getDataChanged()) {
if ($this->getType() === 'document' && $this->getCustomSetting(self::CUSTOM_SETTING_PDF_SCAN_STATUS) != null {
$this->setCustomSetting(
self::CUSTOM_SETTING_PDF_SCAN_STATUS,
null
);
$this->save([updateScanStatus => true]);
}
if (in_array($this->getType(), ['image', 'video', 'document'])) {
$this->addToUpdateTaskQueue();
}
} |
@cancan101 Yes this is possible, but then you have 2 system saved versions in the history, which feels a little bit wrong |
|
You could disable creating version |
@cancan101 Sounds good for me. Could you please implement this? Thank you in advance |
Changes in this pull request
Resolves #
Additional info