Commit 3cff1c9d authored by Jacob Rockowitz's avatar Jacob Rockowitz Committed by Jacob Rockowitz
Browse files

Issue #3257109 by bletch, jrockowitz: Deprecated function: strpos(): Passing...

Issue #3257109 by bletch, jrockowitz: Deprecated function: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated
parent 6ace8306
Loading
Loading
Loading
Loading
+8 −5
Changes for modules/webform_ui/src/PathProcessor/WebformUiPathProcessor.php: 8 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -15,7 +15,10 @@ class WebformUiPathProcessor implements OutboundPathProcessorInterface {
   * {@inheritdoc}
   */
  public function processOutbound($path, &$options = [], Request $request = NULL, BubbleableMetadata $bubbleable_metadata = NULL) {
    if (is_null($request) || (strpos($path, '/webform/') === FALSE)) {
    if ((strpos($path, '/webform/') === FALSE)
      || is_null($request)
      || is_null($request->getQueryString())
    ) {
      return $path;
    }

@@ -23,13 +26,13 @@ class WebformUiPathProcessor implements OutboundPathProcessorInterface {
      return $path;
    }

    $querystring = [];
    parse_str($request->getQueryString(), $querystring);
    if (empty($querystring['destination'])) {
    $query = [];
    parse_str($request->getQueryString(), $query);
    if (empty($query['destination'])) {
      return $path;
    }

    $destination = $querystring['destination'];
    $destination = $query['destination'];
    $options['query']['destination'] = $destination;
    return $path;
  }