Skip to content
Snippets Groups Projects

3023322 - Contextual Links Style Update

7 unresolved threads
2 files
+ 148
3
Compare changes
  • Side-by-side
  • Inline
Files
2
  • bb486268
    Issue #3250349 by alexpott:... · bb486268
    Lee Rowlands authored
    Issue #3250349 by alexpott: \Drupal\Core\Datetime\Element\Datelist::processDatelist() does not use trusted callbacks - #date_date_callbacks only partially converted to TrustedCallbackInterface in 9.3.x
@@ -3,9 +3,13 @@
namespace Drupal\Core\Datetime\Element;
use Drupal\Component\Utility\NestedArray;
use Drupal\Component\Utility\Variable;
use Drupal\Core\Datetime\DateHelper;
use Drupal\Core\Datetime\DrupalDateTime;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Security\DoTrustedCallbackTrait;
use Drupal\Core\Security\StaticTrustedCallbackHelper;
use Drupal\Core\Security\TrustedCallbackInterface;
/**
* Provides a datelist element.
@@ -14,6 +18,8 @@
*/
class Datelist extends DateElementBase {
use DoTrustedCallbackTrait;
/**
* {@inheritdoc}
*/
@@ -261,9 +267,8 @@ public static function processDatelist(&$element, FormStateInterface $form_state
// Allows custom callbacks to alter the element.
if (!empty($element['#date_date_callbacks'])) {
foreach ($element['#date_date_callbacks'] as $callback) {
if (function_exists($callback)) {
$callback($element, $form_state, $date);
}
$message = sprintf('Datelist element #date_date_callbacks callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. Support for this callback implementation is deprecated in drupal:9.3.0 and will be removed in drupal:10.0.0. See https://www.drupal.org/node/3217966', Variable::callableToString($callback));
StaticTrustedCallbackHelper::callback($callback, [&$element, $form_state, $date], $message, TrustedCallbackInterface::TRIGGER_SILENCED_DEPRECATION);
}
}
Loading