aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/db/migrator.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2016-10-25 20:25:57 +0200
committerMarc Alexander <admin@m-a-styles.de>2016-10-25 20:25:57 +0200
commitffc6623dd4b66f039698d86701c49724bc217bc7 (patch)
tree020620452cc6a2a2fa6a414128b75a7f63abd205 /phpBB/phpbb/db/migrator.php
parent6f8c0df1c68a2f7812c10ffd489098f50401022d (diff)
downloadforums-ffc6623dd4b66f039698d86701c49724bc217bc7.tar
forums-ffc6623dd4b66f039698d86701c49724bc217bc7.tar.gz
forums-ffc6623dd4b66f039698d86701c49724bc217bc7.tar.bz2
forums-ffc6623dd4b66f039698d86701c49724bc217bc7.tar.xz
forums-ffc6623dd4b66f039698d86701c49724bc217bc7.zip
[ticket/14831] Rename migration and replace preg_replace() with simpler methods
PHPBB3-14831
Diffstat (limited to 'phpBB/phpbb/db/migrator.php')
-rw-r--r--phpBB/phpbb/db/migrator.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php
index 30eafcc470..45a333ac94 100644
--- a/phpBB/phpbb/db/migrator.php
+++ b/phpBB/phpbb/db/migrator.php
@@ -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]))
{