Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#50532 closed defect (bug) (duplicate)

Undefined index SERVER_NAME

Reported by: malthert's profile malthert Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.5
Component: Mail Keywords:
Focuses: Cc:

Description

wp-includes/pluggable.php

<?php
$sitename = strtolower( $_SERVER['SERVER_NAME'] );

1) this requires an !empty check to avoid a notice
2) I suggest to change this to HTTP_HOST as this is more commonly correct (if not set) than SERVER_NAME (maybe fallback to SERVER_NAME)
3) this must be properly sanitized

Change History (1)

#1 @SergeyBiryukov
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi there, welcome back to WordPress Trac!

Thanks for the report, we're already tracking this issue in #25239.

Note: See TracTickets for help on using tickets.