Commit 72f72d20 authored by rhys's avatar rhys
Browse files

Issue #3271585 by rromore, rhys: BooleanSetting using value of markup instead of raw value

parent 9b215c18
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -91,10 +91,14 @@ class BooleanSetting extends DesignSettingBase {
    $output = $this->renderer->render($build);

    // Process the rendered content using PHP coersion.
    $output = trim(strip_tags($output));
    $result = filter_var($output, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);

    // Respond using the values provided by the configuration.
    if ($this->configuration['string']) {
      return ['#markup' => $result ? $this->configuration['on'] : $this->configuration['off']];
    }
    return ['#markup' => $result];
  }

}