Skip to content

Commit

Permalink
Remove unused code for local .ics file
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanHerman committed Jun 20, 2024
1 parent fee3add commit 72d3c2a
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions includes/ical-parser/class-coblocks-ical.php
Original file line number Diff line number Diff line change
Expand Up @@ -2719,36 +2719,6 @@ protected function file_or_url( $filename ) {
}
return explode( "\n", wp_remote_retrieve_body( $request ) );
}

$options = array();
if ( ! empty( $this->http_basic_auth ) || ! empty( $this->http_user_agent ) ) {
$options['http'] = array();
$options['http']['header'] = array();

if ( ! empty( $this->http_basic_auth ) ) {
$username = $this->http_basic_auth['username'];
$password = $this->http_basic_auth['password'];
// base64_encode() used to encode auth credentials.
$basic_auth = base64_encode( "{$username}:{$password}" ); // phpcs:ignore

array_push( $options['http']['header'], "Authorization: Basic {$basic_auth}" );
}

if ( ! empty( $this->http_user_agent ) ) {
array_push( $options['http']['header'], "User-Agent: {$this->http_user_agent}" );
}
}

$context = stream_context_create( $options );
$lines = file( $filename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES, $context );

if ( false === $lines ) {

throw new \Exception( "The file path or URL '{$filename}' does not exist." );

}

return $lines;
}

/**
Expand Down

0 comments on commit 72d3c2a

Please sign in to comment.