mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-02 01:22:37 +00:00
Replace rtrim with preg_replace in SchemaShell
The second parameter of rtrim is a character mask, not a string to be replaced. It was breaking file names ending in one or more 'p' or 'h' characters.
This commit is contained in:
parent
6cb21e6dc8
commit
4b3386c16f
1 changed files with 2 additions and 2 deletions
|
@ -158,7 +158,7 @@ class SchemaShell extends AppShell {
|
|||
}
|
||||
|
||||
if ($snapshot === true) {
|
||||
$fileName = rtrim($this->params['file'], '.php');
|
||||
$fileName = preg_replace('`\.php$`', '', $this->params['file'], 1);
|
||||
$Folder = new Folder($this->Schema->path);
|
||||
$result = $Folder->read();
|
||||
|
||||
|
@ -285,7 +285,7 @@ class SchemaShell extends AppShell {
|
|||
'connection' => $this->params['connection'],
|
||||
);
|
||||
if (!empty($this->params['snapshot'])) {
|
||||
$fileName = rtrim($this->Schema->file, '.php');
|
||||
$fileName = preg_replace('`\.php$`', '', $this->Schema->file, 1);
|
||||
$options['file'] = $fileName . '_' . $this->params['snapshot'] . '.php';
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue