Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-27795

Notice thrown when declaring empty HTTP headers in Legacy

    XMLWordPrintable

Details

    Description

      When using empty values for the HTTP headers in the Legacy settings, like the following:

      Pragma[/]=
      

      results in the following notice being displayed:

      ( ! ) Notice: Undefined offset: 1 in C:\Apache24\htdocs\ezpublish\vendor\ezsystems\ezpublish-kernel\eZ\Bundle\EzPublishLegacyBundle\LegacyResponse\LegacyResponseManager.php on line 165
      Call Stack
      #	Time	Memory	Function	Location
      1	0.0001	236792	{main}( )	...\index.php:0
      2	0.0158	1189392	FOS\HttpCacheBundle\SymfonyCache\EventDispatchingHttpCache->handle( )	...\index.php:77
      3	0.0191	1235104	Symfony\Component\HttpKernel\HttpCache\HttpCache->handle( )	...\EventDispatchingHttpCache.php:122
      4	0.0193	1240048	Symfony\Component\HttpKernel\HttpCache\HttpCache->lookup( )	...\HttpCache.php:210
      5	0.0195	1240632	FOS\HttpCacheBundle\SymfonyCache\EventDispatchingHttpCache->fetch( )	...\HttpCache.php:344
      6	0.0195	1240792	Symfony\Component\HttpKernel\HttpCache\HttpCache->fetch( )	...\EventDispatchingHttpCache.php:143
      7	0.0196	1243480	Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache->forward( )	...\HttpCache.php:448
      8	0.1038	5640152	Symfony\Component\HttpKernel\HttpCache\HttpCache->forward( )	...\HttpCache.php:60
      9	0.1038	5646840	Symfony\Component\HttpKernel\Kernel->handle( )	...\HttpCache.php:491
      10	0.1199	6154632	Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle( )	...\bootstrap.php.cache:2490
      11	0.1201	6156240	Symfony\Component\HttpKernel\HttpKernel->handle( )	...\bootstrap.php.cache:3262
      12	0.1201	6157072	Symfony\Component\HttpKernel\HttpKernel->handleRaw( )	...\bootstrap.php.cache:3108
      13	0.4590	11255952	call_user_func_array:{C:\Apache24\htdocs\ezpublish\ezpublish\bootstrap.php.cache:3149} ( )	...\bootstrap.php.cache:3149
      14	0.4590	11256448	eZ\Bundle\EzPublishLegacyBundle\Controller\LegacyKernelController->indexAction( )	...\bootstrap.php.cache:3149
      15	0.7563	17723992	eZ\Bundle\EzPublishLegacyBundle\LegacyResponse\LegacyResponseManager->mapHeaders( )	...\LegacyKernelController.php:117
      

      Currently, the documentation doesn't specify what should happen when the value for HTTP Header setting is empty. In the case above, the header with an empty value is added, despite the notice. Also, pure Legacy also adds the header with an empty value, but without the notice.

      Steps to reproduce

      1. Create new eZPublish installation (eZ Demo Site without the demo content)
      2. Add the following to the site.ini.append.php file:
        [HTTPHeaderSettings]
        CustomHeader=enabled
        Pragma[/]=
        
      3. Make sure the installation is running in the prod environment and that in your php.ini file you have error_reporting set to E_ALL and display_errors to On.
      4. Go to your-site.dev/content/view/full/2 . The notice pasted above will be displayed. Also, the response will have a "Pragma:" header with an empty value.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jacek.foremski-obsolete@ez.no Jacek Foremski (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: