Possibly, as described, DoDeletePage? is not the only place where to apply. Others, too: DoHistory.
sub DoDeletePage { my ($id) = @_; return if (!&ValidIdOrDie($id)); print &GetHeader('', Ts('Delete %s', $id), ''); return if (!&UserIsAdminOrError()); + if (!-f &GetPageFile($id)) { + print T('Invalid URL or file does not exist --nothing done'); + print &GetCommonFooter(); + return; + } if ($ConfirmDel && !&GetParam('confirm', 0)) { ... sub DoHistory { my ($id) = @_; my ($html, $canEdit, $row, $newText); + return if (!&ValidIdOrDie($id)); print &GetHeader('', Ts('History of %s', $id), ''); + if (!-f &GetPageFile($id)) { + print T('Invalid URL or file does not exist --nothing done'); + print &GetCommonFooter(); + return; + } &OpenPage($id); &OpenDefaultText();--JuanmaMP