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

Slashes in view parameters cause php notice

    XMLWordPrintable

    Details

      Description

      If we add slashes in a view parameter it will cause a php notice. This should not be expected.

      Steps to reproduce:
      1. Set a 5.4.7 environment in dev mode
      2. Access to http://your.site/(offset)/http://www.google.com
      3. Confirm you can see the notice as described

      Returned notice:

      Whoops, looks like something went wrong.
      2/2 ContextErrorException in SiteAccessListener.php line 142: Notice: Uninitialized string offset: 0
      
          in SiteAccessListener.php line 142
          at ErrorHandler->handleError('8', 'Uninitialized string offset: 0', '/var/www/ezpublish54/vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/EventListener/SiteAccessListener.php', '142', array('vpString' => '(offset)/http://www.google.com', 'viewParameters' => array('offset' => 'http:'), 'vpSegments' => array('(offset)', '', 'www.google.com'), 'i' => '2', 'iMax' => '4', 'paramName' => 'offset')) in SiteAccessListener.php line 142
          at SiteAccessListener->generateViewParametersArray('(offset)/http://www.google.com') in SiteAccessListener.php line 114
          at SiteAccessListener->getViewParameters('/(offset)/http://www.google.com') in SiteAccessListener.php line 87
          at SiteAccessListener->onSiteAccessMatch(object(PostSiteAccessMatchEvent), 'ezpublish.siteaccess', object(TraceableEventDispatcher))
          at call_user_func(array(object(SiteAccessListener), 'onSiteAccessMatch'), object(PostSiteAccessMatchEvent), 'ezpublish.siteaccess', object(TraceableEventDispatcher)) in WrappedListener.php line 61
          at WrappedListener->__invoke(object(PostSiteAccessMatchEvent), 'ezpublish.siteaccess', object(TraceableEventDispatcher))
          at call_user_func(object(WrappedListener), object(PostSiteAccessMatchEvent), 'ezpublish.siteaccess', object(TraceableEventDispatcher)) in WrappedListener.php line 61
          at WrappedListener->__invoke(object(PostSiteAccessMatchEvent), 'ezpublish.siteaccess', object(ContainerAwareEventDispatcher))
          at call_user_func(object(WrappedListener), object(PostSiteAccessMatchEvent), 'ezpublish.siteaccess', object(ContainerAwareEventDispatcher)) in EventDispatcher.php line 161
          at EventDispatcher->doDispatch(array(object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener)), 'ezpublish.siteaccess', object(PostSiteAccessMatchEvent)) in EventDispatcher.php line 46
          at EventDispatcher->dispatch('ezpublish.siteaccess', object(PostSiteAccessMatchEvent)) in TraceableEventDispatcher.php line 128
          at TraceableEventDispatcher->dispatch('ezpublish.siteaccess', object(PostSiteAccessMatchEvent)) in SiteAccessMatchListener.php line 95
          at SiteAccessMatchListener->onKernelRequest(object(GetResponseEvent), 'kernel.request', object(TraceableEventDispatcher))
          at call_user_func(array(object(SiteAccessMatchListener), 'onKernelRequest'), object(GetResponseEvent), 'kernel.request', object(TraceableEventDispatcher)) in WrappedListener.php line 61
          at WrappedListener->__invoke(object(GetResponseEvent), 'kernel.request', object(TraceableEventDispatcher))
          at call_user_func(object(WrappedListener), object(GetResponseEvent), 'kernel.request', object(TraceableEventDispatcher)) in WrappedListener.php line 61
          at WrappedListener->__invoke(object(GetResponseEvent), 'kernel.request', object(ContainerAwareEventDispatcher))
          at call_user_func(object(WrappedListener), object(GetResponseEvent), 'kernel.request', object(ContainerAwareEventDispatcher)) in EventDispatcher.php line 161
          at EventDispatcher->doDispatch(array(object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener)), 'kernel.request', object(GetResponseEvent)) in EventDispatcher.php line 46
          at EventDispatcher->dispatch('kernel.request', object(GetResponseEvent)) in TraceableEventDispatcher.php line 128
          at TraceableEventDispatcher->dispatch('kernel.request', object(GetResponseEvent)) in HttpKernel.php line 125
          at HttpKernel->handleRaw(object(Request), '2') in HttpKernel.php line 64
          at HttpKernel->handle(object(Request), '2', false) in ContainerAwareHttpKernel.php line 69
          at ContainerAwareHttpKernel->handle(object(Request), '2', false) in ExceptionListener.php line 50
          at ExceptionListener->onKernelException(object(GetResponseForExceptionEvent), 'kernel.exception', object(TraceableEventDispatcher))
          at call_user_func(array(object(ExceptionListener), 'onKernelException'), object(GetResponseForExceptionEvent), 'kernel.exception', object(TraceableEventDispatcher)) in WrappedListener.php line 61
          at WrappedListener->__invoke(object(GetResponseForExceptionEvent), 'kernel.exception', object(ContainerAwareEventDispatcher))
          at call_user_func(object(WrappedListener), object(GetResponseForExceptionEvent), 'kernel.exception', object(ContainerAwareEventDispatcher)) in EventDispatcher.php line 161
          at EventDispatcher->doDispatch(array(object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener)), 'kernel.exception', object(GetResponseForExceptionEvent)) in EventDispatcher.php line 46
          at EventDispatcher->dispatch('kernel.exception', object(GetResponseForExceptionEvent)) in TraceableEventDispatcher.php line 128
          at TraceableEventDispatcher->dispatch('kernel.exception', object(GetResponseForExceptionEvent)) in HttpKernel.php line 221
          at HttpKernel->handleException(object(ContextErrorException), object(Request), '1') in HttpKernel.php line 75
          at HttpKernel->handle(object(Request), '1', true) in ContainerAwareHttpKernel.php line 69
          at ContainerAwareHttpKernel->handle(object(Request), '1', true) in Kernel.php line 184
          at Kernel->handle(object(Request)) in index.php line 77
      
      1/2 ContextErrorException in SiteAccessListener.php line 142: Notice: Uninitialized string offset: 0
      
          in SiteAccessListener.php line 142
          at ErrorHandler->handleError('8', 'Uninitialized string offset: 0', '/var/www/ezpublish54/vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/EventListener/SiteAccessListener.php', '142', array('vpString' => '(offset)/http://www.google.com', 'viewParameters' => array('offset' => 'http:'), 'vpSegments' => array('(offset)', '', 'www.google.com'), 'i' => '2', 'iMax' => '4', 'paramName' => 'offset')) in SiteAccessListener.php line 142
          at SiteAccessListener->generateViewParametersArray('(offset)/http://www.google.com') in SiteAccessListener.php line 114
          at SiteAccessListener->getViewParameters('/(offset)/http://www.google.com') in SiteAccessListener.php line 87
          at SiteAccessListener->onSiteAccessMatch(object(PostSiteAccessMatchEvent), 'ezpublish.siteaccess', object(TraceableEventDispatcher))
          at call_user_func(array(object(SiteAccessListener), 'onSiteAccessMatch'), object(PostSiteAccessMatchEvent), 'ezpublish.siteaccess', object(TraceableEventDispatcher)) in WrappedListener.php line 61
          at WrappedListener->__invoke(object(PostSiteAccessMatchEvent), 'ezpublish.siteaccess', object(ContainerAwareEventDispatcher))
          at call_user_func(object(WrappedListener), object(PostSiteAccessMatchEvent), 'ezpublish.siteaccess', object(ContainerAwareEventDispatcher)) in EventDispatcher.php line 161
          at EventDispatcher->doDispatch(array(object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener)), 'ezpublish.siteaccess', object(PostSiteAccessMatchEvent)) in EventDispatcher.php line 46
          at EventDispatcher->dispatch('ezpublish.siteaccess', object(PostSiteAccessMatchEvent)) in TraceableEventDispatcher.php line 128
          at TraceableEventDispatcher->dispatch('ezpublish.siteaccess', object(PostSiteAccessMatchEvent)) in SiteAccessMatchListener.php line 95
          at SiteAccessMatchListener->onKernelRequest(object(GetResponseEvent), 'kernel.request', object(TraceableEventDispatcher))
          at call_user_func(array(object(SiteAccessMatchListener), 'onKernelRequest'), object(GetResponseEvent), 'kernel.request', object(TraceableEventDispatcher)) in WrappedListener.php line 61
          at WrappedListener->__invoke(object(GetResponseEvent), 'kernel.request', object(ContainerAwareEventDispatcher))
          at call_user_func(object(WrappedListener), object(GetResponseEvent), 'kernel.request', object(ContainerAwareEventDispatcher)) in EventDispatcher.php line 161
          at EventDispatcher->doDispatch(array(object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener)), 'kernel.request', object(GetResponseEvent)) in EventDispatcher.php line 46
          at EventDispatcher->dispatch('kernel.request', object(GetResponseEvent)) in TraceableEventDispatcher.php line 128
          at TraceableEventDispatcher->dispatch('kernel.request', object(GetResponseEvent)) in HttpKernel.php line 125
          at HttpKernel->handleRaw(object(Request), '1') in HttpKernel.php line 64
          at HttpKernel->handle(object(Request), '1', true) in ContainerAwareHttpKernel.php line 69
          at ContainerAwareHttpKernel->handle(object(Request), '1', true) in Kernel.php line 184
          at Kernel->handle(object(Request)) in index.php line 77
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              ricardo.correia-obsolete@ez.no Ricardo Correia (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: