Fixed Folder::move() throwing an error when target folder is changed by only appending characters to the end [#3445]

This commit is contained in:
Matias Griese 2021-09-21 13:42:18 +03:00
parent e0c3e28809
commit 370b0674bd
2 changed files with 3 additions and 1 deletions

View File

@ -6,6 +6,8 @@
* Added method `Pages::referrerRoute()` to get the referrer route and language
2. [](#improved)
* `Uri::referrer()` now accepts third parameter, if set to `true`, it returns route without base or language code [#3411](https://github.com/getgrav/grav/issues/3411)
3. [](#bugfix)
* Fixed `Folder::move()` throwing an error when target folder is changed by only appending characters to the end [#3445](https://github.com/getgrav/grav/issues/3445)
# v1.7.22
## 09/16/2021

View File

@ -371,7 +371,7 @@ abstract class Folder
return;
}
if (strpos($target, $source) === 0) {
if (strpos($target, $source . '/') === 0) {
throw new RuntimeException('Cannot move folder to itself');
}