Applying to newsfeeds modal.php same corrections as implemented in
#32379 + some CQ