Deprecated: Optional parameter $content declared before required parameter $tag is implicitly treated as a required parameter in /home/aascu/staging/wp-content/themes/fr-starter-theme-2022/app/Shortcodes/CtaButton/Cta.php on line 35
Cannot modify header information - headers already sent by (output started at /home/aascu/staging/wp-content/themes/fr-starter-theme-2022/app/Shortcodes/CtaButton/Cta.php:35) (500 Internal Server Error)

Symfony Exception

ErrorException

HTTP 500 Internal Server Error

Cannot modify header information - headers already sent by (output started at /home/aascu/staging/wp-content/themes/fr-starter-theme-2022/app/Shortcodes/CtaButton/Cta.php:35)

Exception

ErrorException

  1.         if($file){
  2.             $filename $file['url'];
  3.             $content file_get_contents($filename);
  4.             header('Content-Type: ' $file['mime_type']);
  5.             header('Content-Length: ' strlen($content));
  6.             header('Content-Disposition: inline; filename="'.basename$filename ).'"');
  7.             header('Cache-Control: private, max-age=0, must-revalidate');
  8.             header('Pragma: public');
  9.             ini_set('zlib.output_compression','0');
  1.      * @throws \ErrorException
  2.      */
  3.     public function handleError($level$message$file ''$line 0$context = [])
  4.     {
  5.         try {
  6.             parent::handleError($level$message$file$line$context);
  7.         } catch (Throwable $e) {
  8.             if (! apply_filters('acorn/throw_error_exception'true$e)) {
  9.                 return false;
  10.             }
HandleExceptions->handleError(2, 'Cannot modify header information - headers already sent by (output started at /home/aascu/staging/wp-content/themes/fr-starter-theme-2022/app/Shortcodes/CtaButton/Cta.php:35)', '/home/aascu/staging/wp-content/themes/fr-starter-theme-2022/app/Providers/PostLinkRedirectProvider.php', 66)
  1.         if($file){
  2.             $filename $file['url'];
  3.             $content file_get_contents($filename);
  4.             header('Content-Type: ' $file['mime_type']);
  5.             header('Content-Length: ' strlen($content));
  6.             header('Content-Disposition: inline; filename="'.basename$filename ).'"');
  7.             header('Cache-Control: private, max-age=0, must-revalidate');
  8.             header('Pragma: public');
  9.             ini_set('zlib.output_compression','0');
PostLinkRedirectProvider::RedirectToFileDownload(object(WP_Post)) in /home/aascu/staging/wp-content/themes/fr-starter-theme-2022/app/Providers/PostLinkRedirectProvider.php (line 42)
  1.             $post_link_type get_field('post_link_type'$post);
  2.             if($post_link_type){
  3.                 switch ($post_link_type) {
  4.                     case 'file':
  5.                         self::RedirectToFileDownload($post);
  6.                         break;
  7.                     
  8.                     case 'external':
  9.                         self::RedirectToExternalUrl($post);
  10.                         break;
  1.     public function register()
  2.     {
  3.         add_action('template_redirect', function(){
  4.             if(!function_exists('acf')) return;
  5.             self::PostTemplateRedirect();
  6.         });
  7.     }
  8.     /**
  9.      * Bootstrap services.
PostLinkRedirectProvider->App\Providers\{closure}('') in /home/aascu/staging/wp-includes/class-wp-hook.php (line 324)
  1.                 // Avoid the array_slice() if possible.
  2.                 if ( === $the_['accepted_args'] ) {
  3.                     $value call_user_func$the_['function'] );
  4.                 } elseif ( $the_['accepted_args'] >= $num_args ) {
  5.                     $value call_user_func_array$the_['function'], $args );
  6.                 } else {
  7.                     $value call_user_func_array$the_['function'], array_slice$args0$the_['accepted_args'] ) );
  8.                 }
  9.             }
  10.         } while ( false !== next$this->iterations$nesting_level ] ) );
WP_Hook->apply_filters(null, array('')) in /home/aascu/staging/wp-includes/class-wp-hook.php (line 348)
  1.      *
  2.      * @param array $args Parameters to pass to the callback functions.
  3.      */
  4.     public function do_action$args ) {
  5.         $this->doing_action true;
  6.         $this->apply_filters''$args );
  7.         // If there are recursive calls to the current action, we haven't finished it until we get to the last one.
  8.         if ( ! $this->nesting_level ) {
  9.             $this->doing_action false;
  10.         }
WP_Hook->do_action(array('')) in /home/aascu/staging/wp-includes/plugin.php (line 517)
  1.     } elseif ( is_array$arg[0] ) && === count$arg[0] ) && isset( $arg[0][0] ) && is_object$arg[0][0] ) ) {
  2.         // Backward compatibility for PHP4-style passing of `array( &$this )` as action `$arg`.
  3.         $arg[0] = $arg[0][0];
  4.     }
  5.     $wp_filter$hook_name ]->do_action$arg );
  6.     array_pop$wp_current_filter );
  7. }
  8. /**
do_action('template_redirect') in /home/aascu/staging/wp-includes/template-loader.php (line 13)
  1.     /**
  2.      * Fires before determining which template to load.
  3.      *
  4.      * @since 1.5.0
  5.      */
  6.     do_action'template_redirect' );
  7. }
  8. /**
  9.  * Filters whether to allow 'HEAD' requests to generate content.
  10.  *
require_once('/home/aascu/staging/wp-includes/template-loader.php') in /home/aascu/staging/wp-blog-header.php (line 19)
  1.     // Set up the WordPress query.
  2.     wp();
  3.     // Load the theme template.
  4.     require_once ABSPATH WPINC '/template-loader.php';
  5. }
require('/home/aascu/staging/wp-blog-header.php') in /home/aascu/staging/index.php (line 17)
  1.  * @var bool
  2.  */
  3. define'WP_USE_THEMES'true );
  4. /** Loads the WordPress Environment and Template */
  5. require __DIR__ '/wp-blog-header.php';

Stack Trace

ErrorException
ErrorException:
Cannot modify header information - headers already sent by (output started at /home/aascu/staging/wp-content/themes/fr-starter-theme-2022/app/Shortcodes/CtaButton/Cta.php:35)

  at /home/aascu/staging/wp-content/themes/fr-starter-theme-2022/app/Providers/PostLinkRedirectProvider.php:66
  at Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'Cannot modify header information - headers already sent by (output started at /home/aascu/staging/wp-content/themes/fr-starter-theme-2022/app/Shortcodes/CtaButton/Cta.php:35)', '/home/aascu/staging/wp-content/themes/fr-starter-theme-2022/app/Providers/PostLinkRedirectProvider.php', 66, array())
     (/home/aascu/staging/wp-content/themes/fr-starter-theme-2022/vendor/roots/acorn/src/Roots/Acorn/Bootstrap/HandleExceptions.php:54)
  at Roots\Acorn\Bootstrap\HandleExceptions->handleError(2, 'Cannot modify header information - headers already sent by (output started at /home/aascu/staging/wp-content/themes/fr-starter-theme-2022/app/Shortcodes/CtaButton/Cta.php:35)', '/home/aascu/staging/wp-content/themes/fr-starter-theme-2022/app/Providers/PostLinkRedirectProvider.php', 66)
  at header('Content-Type: application/pdf')
     (/home/aascu/staging/wp-content/themes/fr-starter-theme-2022/app/Providers/PostLinkRedirectProvider.php:66)
  at App\Providers\PostLinkRedirectProvider::RedirectToFileDownload(object(WP_Post))
     (/home/aascu/staging/wp-content/themes/fr-starter-theme-2022/app/Providers/PostLinkRedirectProvider.php:42)
  at App\Providers\PostLinkRedirectProvider::PostTemplateRedirect()
     (/home/aascu/staging/wp-content/themes/fr-starter-theme-2022/app/Providers/PostLinkRedirectProvider.php:19)
  at App\Providers\PostLinkRedirectProvider->App\Providers\{closure}('')
     (/home/aascu/staging/wp-includes/class-wp-hook.php:324)
  at WP_Hook->apply_filters(null, array(''))
     (/home/aascu/staging/wp-includes/class-wp-hook.php:348)
  at WP_Hook->do_action(array(''))
     (/home/aascu/staging/wp-includes/plugin.php:517)
  at do_action('template_redirect')
     (/home/aascu/staging/wp-includes/template-loader.php:13)
  at require_once('/home/aascu/staging/wp-includes/template-loader.php')
     (/home/aascu/staging/wp-blog-header.php:19)
  at require('/home/aascu/staging/wp-blog-header.php')
     (/home/aascu/staging/index.php:17)