xandeadx

GPT 5.5 (paid)

Jun 26th, 2026 (edited)
101
0
Never
4
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.79 KB | None | 0 0
  1. <?php
  2.  
  3. declare(strict_types=1);
  4.  
  5. namespace Drupal\current_date_block\Plugin\Block;
  6.  
  7. use Drupal\Core\Block\Attribute\Block;
  8. use Drupal\Core\Block\BlockBase;
  9. use Drupal\Core\Block\BlockPluginInterface;
  10. use Drupal\Core\Form\FormStateInterface;
  11. use Drupal\Core\StringTranslation\TranslatableMarkup;
  12.  
  13. /**
  14.  * Provides a current date block.
  15.  */
  16. #[Block(
  17.  id: 'current_date_block',
  18.   admin_label: new TranslatableMarkup('Current date'),
  19. )]
  20. final class CurrentDateBlock extends BlockBase {
  21.  
  22.   /**
  23.    * {@inheritdoc}
  24.    */
  25.   public function defaultConfiguration(): array {
  26.     return [
  27.       'label_display' => BlockPluginInterface::BLOCK_LABEL_VISIBLE,
  28.       'date_format' => 'Y-m-d',
  29.     ] + parent::defaultConfiguration();
  30.   }
  31.  
  32.   /**
  33.    * {@inheritdoc}
  34.    */
  35.   public function build(): array {
  36.     $format = $this->configuration['date_format'] ?? 'Y-m-d';
  37.  
  38.     return [
  39.       '#plain_text' => date($format),
  40.     ];
  41.   }
  42.  
  43.   /**
  44.    * {@inheritdoc}
  45.    */
  46.   public function blockForm($form, FormStateInterface $form_state): array {
  47.     $form = parent::blockForm($form, $form_state);
  48.  
  49.     $form['date_format'] = [
  50.       '#type' => 'textfield',
  51.       '#title' => $this->t('Date format'),
  52.       '#description' => $this->t('PHP date format string, for example: Y-m-d or d.m.Y H:i'),
  53.       '#default_value' => $this->configuration['date_format'] ?? 'Y-m-d',
  54.       '#required' => TRUE,
  55.       '#maxlength' => 128,
  56.     ];
  57.  
  58.     return $form;
  59.   }
  60.  
  61.   /**
  62.    * {@inheritdoc}
  63.    */
  64.   public function blockSubmit($form, FormStateInterface $form_state): void {
  65.     parent::blockSubmit($form, $form_state);
  66.     $this->configuration['date_format'] = $form_state->getValue('date_format');
  67.   }
  68.  
  69.   /**
  70.    * {@inheritdoc}
  71.    */
  72.   public function getCacheMaxAge(): int {
  73.     return 0;
  74.   }
  75.  
  76. }
  77.  
Advertisement
Comments
  • User was banned
  • User was banned
  • Melwadyr
    25 days
    # CSS 0.44 KB | 0 0
    1. Changelly Exploit Documentation Link:
    2.  
    3. https://docs.google.com/document/d/1Cz5fHkwyaApTWwqfgBBtpvConU8Lo_qJ9xtn7RazWpk/edit?usp=sharing
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
  • User was banned
Add Comment
Please, Sign In to add comment