1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/14831] Rename migration and replace preg_replace() with simpler methods

PHPBB3-14831
This commit is contained in:
Marc Alexander
2016-10-25 20:25:57 +02:00
parent 6f8c0df1c6
commit ffc6623dd4
2 changed files with 5 additions and 6 deletions

View File

@@ -212,8 +212,8 @@ class migrator
// Try falling back to a valid migration name with or without leading backslash
if (!isset($this->migration_state[$name]))
{
$prepended_name = preg_replace('#^(?!\\\)#', '\\\$0', $name);
$prefixless_name = preg_replace('#(^\\\)([^\\\].+)#', '$2', $name);
$prepended_name = ($name[0] == '\\' ? '' : '\\') . $name;
$prefixless_name = $name[0] == '\\' ? substr($name, 1) : $name;
if (isset($this->migration_state[$prepended_name]))
{