Commit 26915907 authored by Sharique Farooqui's avatar Sharique Farooqui Committed by Nigel Cunningham
Browse files

Issue #3322646 by Sharique: Unknown function Unicode::strtolower and Unicode::strpos

parent 718d8862
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@

namespace Drupal\webform_score\Plugin\WebformScore;

use Drupal\Component\Utility\Unicode;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\TypedData\TypedDataInterface;
use Drupal\webform_score\Plugin\WebformScoreInterface;
@@ -35,11 +34,11 @@ class Contains extends WebformScoreBase implements WebformScoreInterface {
    $answer = $answer->getValue();
    $expected = $this->configuration['expected'];
    if (!$this->configuration['case_sensitive']) {
      $answer = Unicode::strtolower($answer);
      $expected = Unicode::strtolower($expected);
      $answer = mb_strtolower($answer);
      $expected = mb_strtolower($expected);
    }

    return Unicode::strpos($answer, $expected) === FALSE ? 0 : $this->getMaxScore();
    return mb_strpos($answer, $expected) === FALSE ? 0 : $this->getMaxScore();
  }

  /**