Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Commit

Permalink
Merge pull request #626 from lutskanu/master
Browse files Browse the repository at this point in the history
Fixed issue when Notice "Undefined variable: header" occured on PHP 7.0
  • Loading branch information
SammyK committed Aug 6, 2016
2 parents c57935a + b5bd073 commit f7ca208
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Facebook/Url/FacebookUrlDetectionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ protected function protocolWithActiveSsl($protocol)
protected function getHostName()
{
// Check for proxy first
if ($header = $this->getHeader('X_FORWARDED_HOST') && $this->isValidForwardedHost($header)) {
$header = $this->getHeader('X_FORWARDED_HOST');
if ($header && $this->isValidForwardedHost($header)) {
$elements = explode(',', $header);
$host = $elements[count($elements) - 1];
} elseif (!$host = $this->getHeader('HOST')) {
Expand Down

0 comments on commit f7ca208

Please sign in to comment.