Avoid use of assignments bare inside statements

Either use them in a subroutine call or put parentheses around the assignment.
This commit is contained in:
Alexei Sorokin
2020-09-08 12:42:51 +03:00
parent d0f96a7023
commit adc689cb15
15 changed files with 934 additions and 791 deletions

View File

@@ -115,7 +115,13 @@ class OEmbedAction extends Action
// TRANS: %d is an attachment ID.
$this->clientError(sprintf(_('Attachment %s not found.'), $id), 404);
}
if (empty($attachment->filename) && $file_oembed = File_oembed::getKV('file_id', $attachment->id)) {
if (
empty($attachment->filename)
&& !empty($file_oembed = File_oembed::getKV(
'file_id',
$attachment->id
))
) {
// Proxy the existing oembed information
$oembed['type']=$file_oembed->type;
$oembed['provider']=$file_oembed->provider;