Skip to content

Commit

Permalink
Merge branch '11.1' into 11.x
Browse files Browse the repository at this point in the history
# Conflicts:
#	doc/03_Documents/01_Editables/40_WYSIWYG.md
  • Loading branch information
fashxp committed Nov 29, 2023
2 parents 503ef79 + b0b6b88 commit ebf28dc
Show file tree
Hide file tree
Showing 15 changed files with 44 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ If you choose to install backend search (which is installed by default), you mus
:::

5. :heavy_check_mark: DONE - You can now visit your pimcore instance:
* The frontend: <http://localhost>
* The frontend: [localhost](http://localhost)
* The admin interface, using the credentials you have chosen above:
<http://localhost/admin>
[Admin interface](http://localhost/admin)


## Caching
Expand Down
2 changes: 1 addition & 1 deletion doc/02_MVC/04_Routing_and_URLs/02_Custom_Routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ to do so just embrace the part with curly brackets { } (see example below).

| Name | Pattern | Reverse | Controller | Variables | Defaults | Site IDs | Priority | Methods |
|----------|------------------------|------------------|-----------------------------------------------|-----------|--------------|----------|--------------|-------------|
| news category | /\\/news-category\\/([^_]+)_([0-9]+)(_category_)?([0-9]+)?/ | /news-category/%text_%id{_category_%categoryId} | App\Controller\NewsController::listingAction | text,id,text2,categoryId | | | 1 | |
| news category | /\\/news-category\\/([^_]+)_([0-9]+)(_category_)?([0-9]+)?/ | /news-category/%text_%id\{_category_%categoryId\} | App\Controller\NewsController::listingAction | text,id,text2,categoryId | | | 1 | |

![Grid with the new route](../../img/Routing_grid2.png)

Expand Down
2 changes: 1 addition & 1 deletion doc/03_Documents/01_Editables/02_Areablock/02_Bricks.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ as registered on the areabrick manager (see below).
| Location | Path |
|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| global | `templates/areas/<brickId>/` |
| bundle | `<bundlePath>/Resources/views/areas/<brickId>/` for legacy (Symfony <= 4) bundle structure<br/>or<br/>`<bundlePath>/templates/areas/<brickId>/` for modern (Symfony >= 5) bundle structure |
| bundle | `<bundlePath>/Resources/views/areas/<brickId>/` for legacy (Symfony \<= 4) bundle structure<br/>or<br/>`<bundlePath>/templates/areas/<brickId>/` for modern (Symfony >= 5) bundle structure |

Depending on the template location, the following files will be used. You can always completely control locations by
implementing the methods for templates and icon yourself (see `AreabrickInterface`):
Expand Down
2 changes: 1 addition & 1 deletion doc/03_Documents/01_Editables/02_Areablock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ And you can see the effect, below:
| `manual` | bool | Forces the manual mode, which enables a complete free implementation for areablocks, for example using real `<table>` elements... example see below |
| `reload` | bool | Set to `true`, to force a reload in editmode after reordering items (default: `false`) |
| `limit` | int | Limit the amount of elements |
| `limits` | array | An array of area-ID's with count to limit the amount of certain elements e.g. {"iframe": 1, "teasers": 2} |
| `limits` | array | An array of area-ID's with count to limit the amount of certain elements e.g. \{"iframe": 1, "teasers": 2\} |
| `areablock_toolbar` | array | Array with option that allows you to configure the toolbar. Possible options are `width`, `buttonWidth` and `buttonMaxCharacters` |
| `controlsAlign` | string | The position of the control button bar. Options are: `top`, `right` and `left`. |
| `controlsTrigger` | string | Options are: `hover`(default) and `fixed` . |
Expand Down
2 changes: 1 addition & 1 deletion doc/03_Documents/01_Editables/40_WYSIWYG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ framework:
```
If you want to adapt this configuration please have a look at the [symfony documentation](https://symfony.com/doc/current/html_sanitizer.html). Add your custom configuration to you project, e.g. to `config/packages/html_sanitizer.yaml`

> Note: When using API to set WYSIWYG data, please pass encoded characters for html entities e.g. <,>, & etc.
> Note: When using API to set WYSIWYG data, please pass encoded characters for html entities e.g. `<`,`>`, `&` etc.
> The data is encoded by the sanitizer before persisting into db and the same encoded data will be returned by the API.
2 changes: 1 addition & 1 deletion doc/19_Development_Tools_and_Details/07_Logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pimcore:
| 2 | User-ID |
| Pimcore\Bundle\AdminBundle\Controller\Admin\Document\PageController::saveAction | Module\Controller::Action |
| pimcore_admin_document_page_save | Route name |
| {"task":"pub .... | Request Parameters (shortened & censored) |
| \{"task":"pub .... \} | Request Parameters (shortened & censored) |

## redirect.log
Sometimes it's necessary to debug redirects, for example when a redirect ends in an infinite loop.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pimcore_admin:
```
> Please note:
> custom_admin_path_identifier should be at least 20 characters long
> and must not start with `/admin` if Pimcore version <= 6.0.5 !
> and must not start with `/admin` if Pimcore version \<= 6.0.5 !
Add custom entry for `PimcoreCoreBundle:PublicServices:customAdminEntryPoint` in your routing.yaml:
```yaml
Expand Down
2 changes: 1 addition & 1 deletion doc/20_Extending_Pimcore/17_Custom_Persistent_Models.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Pimcore provides 2 possible ways of working with custom entities namely Doctrine

## Option 1: Use Doctrine ORM
Pimcore comes already with the Doctrine bundle, so you can easily create your own entities.
Please check <https://symfony.com/doc/current/doctrine.html> for more details.
Please check [https://symfony.com/doc/current/doctrine.html](https://symfony.com/doc/current/doctrine.html) for more details.

## Option 2: Working with Pimcore Data Access Objects (Dao)

Expand Down
2 changes: 1 addition & 1 deletion doc/21_Deployment/01_Version_Control_Systems.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Since Pimcore creates lots of temporary files during runtime it's recommended to

If using Git for your project we recommend the following `.gitignore`:

* <https://github.com/pimcore/demo/blob/11.x/.gitignore>
* [https://github.com/pimcore/demo/blob/11.x/.gitignore](https://github.com/pimcore/demo/blob/11.x/.gitignore)
4 changes: 2 additions & 2 deletions doc/21_Deployment/03_Configuration_Environments.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ or (e.g. in *prod* environments) you can configure everything via real environme

In addition to Symfony configurations, Pimcore also supports environment specific configs for:

* <https://github.com/pimcore/demo/tree/11.x/config/pimcore>
* <https://github.com/pimcore/demo/tree/11.x/var/config>
* [https://github.com/pimcore/demo/tree/11.x/config/pimcore](https://github.com/pimcore/demo/tree/11.x/config/pimcore)
* [https://github.com/pimcore/demo/tree/11.x/var/config](https://github.com/pimcore/demo/tree/11.x/var/config)


## Configuration Storage Locations & Fallbacks
Expand Down
6 changes: 3 additions & 3 deletions doc/21_Deployment/05_Deployment_Tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ All Pimcore configurations are saved as YAML or PHP files on the file system. As
[multi environment feature](03_Configuration_Environments.md) different configuration files for different deployment stages
can be defined.

* <https://github.com/pimcore/demo/tree/11.x/config>
* <https://github.com/pimcore/demo/tree/11.x/config/pimcore>
* <https://github.com/pimcore/demo/tree/11.x/var/config>
* [https://github.com/pimcore/demo/tree/11.x/config](https://github.com/pimcore/demo/tree/11.x/config)
* [https://github.com/pimcore/demo/tree/11.x/config/pimcore](https://github.com/pimcore/demo/tree/11.x/config/pimcore)
* [https://github.com/pimcore/demo/tree/11.x/var/config](https://github.com/pimcore/demo/tree/11.x/var/config)


## Pimcore Class Definitions
Expand Down
2 changes: 1 addition & 1 deletion doc/23_Installation_and_Upgrade/01_System_Requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ For production, we highly recommend a *nix based system.
- Nginx


### PHP >=8.1 <8.3
### PHP >=8.1 \<8.3
Both **mod_php** and **FCGI (FPM)** are supported.

#### Required Settings and Modules & Extensions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Upgrading Pimcore from Version 6.x to Version 10

## System Requirement changes
- PHP >=8.0 <8.2
- PHP >=8.0 \<8.2
- Apache >= 2.4
- Composer >= 2.0

> As Pimcore 6.x works only with PHP < 8.0 and Pimcore 10 works only with PHP >=8.0 <8.2, a switch of PHP version is needed during the upgrade process.
> As Pimcore 6.x works only with PHP < 8.0 and Pimcore 10 works only with PHP >=8.0 \<8.2, a switch of PHP version is needed during the upgrade process.
## Database Requirement changes
- MariaDB >= 10.3
Expand Down Expand Up @@ -163,10 +163,10 @@ mv var/config/custom-logo.* var/admin/custom-logo.image

## SWITCH COMPOSER AND PHP VERSION, AND DO THE UPDATE!
- Ensure Composer is updated to version >= 2.0
- Switch PHP version to PHP >=8.0 <8.2
- Switch PHP version to PHP >=8.0 \<8.2
- Run composer update (`COMPOSER_MEMORY_LIMIT=-1 composer update`)

## CHANGES TO DO AFTER THE UPDATE! (TO DO WITH PHP >=8.0 <8.2)
## CHANGES TO DO AFTER THE UPDATE! (TO DO WITH PHP >=8.0 \<8.2)

### Verify migrations execution
By default, Composer update runs Pimcore migrations automatically, however it is better to check if all migrations are executed for smooth transition.
Expand Down
2 changes: 1 addition & 1 deletion doc/23_Installation_and_Upgrade/09_Upgrade_Notes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ The tokens for password reset are now stored in the DB and are one time use only

- Enabled Content Security Policy by default.
- Implemented Symfony HTML sanitizer for WYSIWYG editors. Please make sure to sanitize your persisted data with help of this [script](https://gist.github.com/dvesh3/0e585a16dfbf546bc17a9eef1c5640b3).
Also, when using API to set WYSIWYG data, please pass encoded characters for html entities <,>, & etc.
Also, when using API to set WYSIWYG data, please pass encoded characters for html entities `<`,`>`, `&` etc.
The data is encoded by the sanitizer before persisting into db and the same encoded data will be returned by the API.


Expand Down
44 changes: 23 additions & 21 deletions models/DataObject/ClassDefinition/Data/Password.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,27 +105,29 @@ public function getDataForResource(mixed $data, DataObject\Concrete $object = nu
}

// is already a hashed string? Then do not re-hash
$info = password_get_info($data);
if ($info['algo'] !== null && $info['algo'] !== 0) {
return $data;
}

// password_get_info() will not detect older, less secure, hashing algos.
// It might not detect some less common ones as well.
$maybeHash = preg_match('/^[a-f0-9]{32,}$/i', $data);
$hashLenghts = [
32, // MD2, MD4, MD5, RIPEMD-128, Snefru 128, Tiger/128, HAVAL128
40, // SHA-1, HAS-160, RIPEMD-160, Tiger/160, HAVAL160
48, // Tiger/192, HAVAL192
56, // SHA-224, HAVAL224
64, // SHA-256, BLAKE-256, GOST, GOST CryptoPro, HAVAL256, RIPEMD-256, Snefru 256
96, // SHA-384
128, // SHA-512, BLAKE-512, SWIFFT
];

if ($maybeHash && in_array(strlen($data), $hashLenghts, true)) {
// Probably already a hashed string
return $data;
if($this->getAlgorithm() === self::HASH_FUNCTION_PASSWORD_HASH) {
$info = password_get_info($data);
if ($info['algo'] !== null && $info['algo'] !== 0) {
return $data;
}
} else {
// password_get_info() will not detect older, less secure, hashing algos.
// It might not detect some less common ones as well.
$maybeHash = preg_match('/^[a-f0-9]{32,}$/i', $data);
$hashLenghts = [
32, // MD2, MD4, MD5, RIPEMD-128, Snefru 128, Tiger/128, HAVAL128
40, // SHA-1, HAS-160, RIPEMD-160, Tiger/160, HAVAL160
48, // Tiger/192, HAVAL192
56, // SHA-224, HAVAL224
64, // SHA-256, BLAKE-256, GOST, GOST CryptoPro, HAVAL256, RIPEMD-256, Snefru 256
96, // SHA-384
128, // SHA-512, BLAKE-512, SWIFFT
];

if ($maybeHash && in_array(strlen($data), $hashLenghts, true)) {
// Probably already a hashed string
return $data;
}
}

$hashed = $this->calculateHash($data);
Expand Down

0 comments on commit ebf28dc

Please sign in to comment.