From b2f00d92161b7abd7760d527fd68b724267ace59 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Thu, 9 Apr 2020 22:01:28 +0200 Subject: [PATCH] Fixed incorrect detection of numerics --- .../lib/system/importer/AbstractAttachmentImporter.class.php | 2 +- .../install/files/lib/system/importer/ArticleImporter.class.php | 2 +- .../install/files/lib/system/importer/MediaImporter.class.php | 2 +- .../install/files/lib/system/importer/UserImporter.class.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/lib/system/importer/AbstractAttachmentImporter.class.php b/wcfsetup/install/files/lib/system/importer/AbstractAttachmentImporter.class.php index 896dc16949..54c8ad3e6b 100644 --- a/wcfsetup/install/files/lib/system/importer/AbstractAttachmentImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/AbstractAttachmentImporter.class.php @@ -47,7 +47,7 @@ class AbstractAttachmentImporter extends AbstractImporter { $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']); // check existing attachment id - if (is_numeric($oldID)) { + if (ctype_digit((string)$oldID)) { $attachment = new Attachment($oldID); if (!$attachment->attachmentID) $data['attachmentID'] = $oldID; } diff --git a/wcfsetup/install/files/lib/system/importer/ArticleImporter.class.php b/wcfsetup/install/files/lib/system/importer/ArticleImporter.class.php index 8638969770..9fedffe56d 100644 --- a/wcfsetup/install/files/lib/system/importer/ArticleImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/ArticleImporter.class.php @@ -66,7 +66,7 @@ class ArticleImporter extends AbstractImporter { } // check old id - if (is_numeric($oldID)) { + if (ctype_digit((string)$oldID)) { $article = new Article($oldID); if (!$article->articleID) $data['articleID'] = $oldID; } diff --git a/wcfsetup/install/files/lib/system/importer/MediaImporter.class.php b/wcfsetup/install/files/lib/system/importer/MediaImporter.class.php index d7c82ec97a..a483f46699 100644 --- a/wcfsetup/install/files/lib/system/importer/MediaImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/MediaImporter.class.php @@ -63,7 +63,7 @@ class MediaImporter extends AbstractImporter { } // check old id - if (is_numeric($oldID)) { + if (ctype_digit((string)$oldID)) { $media = new Media($oldID); if (!$media->mediaID) $data['mediaID'] = $oldID; } diff --git a/wcfsetup/install/files/lib/system/importer/UserImporter.class.php b/wcfsetup/install/files/lib/system/importer/UserImporter.class.php index 1bbcd77645..5994d9fd1b 100644 --- a/wcfsetup/install/files/lib/system/importer/UserImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/UserImporter.class.php @@ -97,7 +97,7 @@ class UserImporter extends AbstractImporter { } // check existing user id - if (is_numeric($oldID)) { + if (ctype_digit((string)$oldID)) { $user = new User($oldID); if (!$user->userID) $data['userID'] = $oldID; } -- 2.20.1