Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php /** * @file * Post update functions for Block. */ use Drupal\block\BlockInterfa..
Decoded Output download
<?php
/**
* @file
* Post update functions for Block.
*/
use Drupallock\BlockInterface;
use Drupal\Core\Config\Entity\ConfigEntityUpdater;
/**
* Implements hook_removed_post_updates().
*/
function block_removed_post_updates() {
return [
'block_post_update_disable_blocks_with_missing_contexts' => '9.0.0',
'block_post_update_disabled_region_update' => '9.0.0',
'block_post_update_fix_negate_in_conditions' => '9.0.0',
'block_post_update_replace_node_type_condition' => '10.0.0',
];
}
/**
* Ensures that all block weights are integers.
*/
function block_post_update_make_weight_integer(array &$sandbox = []): void {
\Drupal::classResolver(ConfigEntityUpdater::class)
->update($sandbox, 'block', function (BlockInterface $block): bool {
$weight = $block->getWeight();
if (!is_int($weight)) {
$block->setWeight($weight);
return TRUE;
}
return FALSE;
});
}
?>
Did this file decode correctly?
Original Code
<?php
/**
* @file
* Post update functions for Block.
*/
use Drupal\block\BlockInterface;
use Drupal\Core\Config\Entity\ConfigEntityUpdater;
/**
* Implements hook_removed_post_updates().
*/
function block_removed_post_updates() {
return [
'block_post_update_disable_blocks_with_missing_contexts' => '9.0.0',
'block_post_update_disabled_region_update' => '9.0.0',
'block_post_update_fix_negate_in_conditions' => '9.0.0',
'block_post_update_replace_node_type_condition' => '10.0.0',
];
}
/**
* Ensures that all block weights are integers.
*/
function block_post_update_make_weight_integer(array &$sandbox = []): void {
\Drupal::classResolver(ConfigEntityUpdater::class)
->update($sandbox, 'block', function (BlockInterface $block): bool {
$weight = $block->getWeight();
if (!is_int($weight)) {
$block->setWeight($weight);
return TRUE;
}
return FALSE;
});
}
Function Calls
None |
Stats
MD5 | 144dbb7f3cd13f55102621dbdd782591 |
Eval Count | 0 |
Decode Time | 72 ms |