Skip to content

Commit

Permalink
Merge branch '4.x' of https://github.com/craftcms/cms into 5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Jan 14, 2025
2 parents 2461d9d + 0b32fe3 commit bcf9a50
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
26 changes: 24 additions & 2 deletions src/config/GeneralConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -2698,12 +2698,23 @@ class GeneralConfig extends BaseConfig
/**
* @var string A private, random, cryptographically-secure key that is used for hashing and encrypting data in [[\craft\services\Security]].
*
* This value should be the same across all environments. If this key ever changes, any data that was encrypted with it will be inaccessible.
* ::: warning
* **Do not** share this key publicly. If exposed, it could lead to a compromised system.
* :::
*
* In the event that the key is compromised, a new secure key can be generated with the command:
*
* ```sh
* php craft setup/security-key
* ```
*
* Note that if the key changes, any data that is encrypted with it (e.g. user session cookies) will be inaccessible.
*
* ```php Static Config
* ->securityKey('2cf24dba5...')
* ```
*
* @see https://craftcms.com/knowledge-base/securing-craft
* @group Security
*/
public string $securityKey = '';
Expand Down Expand Up @@ -6296,7 +6307,17 @@ public function sanitizeSvgUploads(bool $value = true): self
/**
* A private, random, cryptographically-secure key that is used for hashing and encrypting data in [[\craft\services\Security]].
*
* This value should be the same across all environments. If this key ever changes, any data that was encrypted with it will be inaccessible.
* ::: warning
* **Do not** share this key publicly. If exposed, it could lead to a compromised system.
* :::
*
* In the event that the key is compromised, a new secure key can be generated with the command:
*
* ```sh
* php craft setup/security-key
* ```
*
* Note that if the key changes, any data that is encrypted with it (e.g. user session cookies) will be inaccessible.
*
* ```php
* ->securityKey('2cf24dba5...')
Expand All @@ -6306,6 +6327,7 @@ public function sanitizeSvgUploads(bool $value = true): self
* @param string $value
* @return self
* @see $securityKey
* @see https://craftcms.com/knowledge-base/securing-craft
* @since 4.2.0
*/
public function securityKey(string $value): self
Expand Down
2 changes: 1 addition & 1 deletion src/services/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ public function deleteFoldersByIds(int|array $folderIds, bool $deleteDir = true)
$assetQuery = Asset::find()->folderId($allFolderIds);
$elementService = Craft::$app->getElements();

foreach ($assetQuery->each() as $asset) {
foreach (Db::each($assetQuery) as $asset) {
/** @var Asset $asset */
$asset->keepFileOnDelete = !$deleteDir;
$elementService->deleteElement($asset, true);
Expand Down

0 comments on commit bcf9a50

Please sign in to comment.