From 96599a6c0b68f9b54b53e998dbe736b1a0ab4395 Mon Sep 17 00:00:00 2001 From: Torben Brodt Date: Sun, 29 Jan 2012 14:59:39 +0100 Subject: [PATCH] label undefined variable issues with TODOs --- wcfsetup/install.php | 2 +- .../files/lib/acp/form/UsersMassProcessingForm.class.php | 2 +- .../install/files/lib/data/language/LanguageEditor.class.php | 4 ++-- .../queue/PackageInstallationQueueAction.class.php | 2 +- wcfsetup/install/files/lib/data/style/StyleEditor.class.php | 2 +- wcfsetup/install/files/lib/system/WCF.class.php | 2 +- .../lib/system/database/editor/MySQLDatabaseEditor.class.php | 2 +- .../lib/system/image/adapter/ImagickImageAdapter.class.php | 2 +- .../lib/system/language/LanguageServerProcessor.class.php | 2 +- .../files/lib/system/option/RadioButtonOptionType.class.php | 2 +- .../files/lib/system/option/SelectOptionType.class.php | 2 +- .../lib/system/package/PackageInstallationSQLParser.class.php | 2 +- .../lib/system/package/PackageInstallationScheduler.class.php | 2 +- .../plugin/ObjectTypePackageInstallationPlugin.class.php | 2 +- 14 files changed, 15 insertions(+), 15 deletions(-) diff --git a/wcfsetup/install.php b/wcfsetup/install.php index 94a16960d0..9d63d0a035 100644 --- a/wcfsetup/install.php +++ b/wcfsetup/install.php @@ -370,7 +370,7 @@ class Tar { } if (!isset($this->contentList[$fileIndex])) { - throw new SystemException("Tar: could find file '$index' in archive"); + throw new SystemException("Tar: could find file '$index' in archive"); //TODO: undefined variable } return $this->contentList[$fileIndex]; } diff --git a/wcfsetup/install/files/lib/acp/form/UsersMassProcessingForm.class.php b/wcfsetup/install/files/lib/acp/form/UsersMassProcessingForm.class.php index 0ad28dd7fe..151828fee0 100644 --- a/wcfsetup/install/files/lib/acp/form/UsersMassProcessingForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UsersMassProcessingForm.class.php @@ -255,7 +255,7 @@ class UsersMassProcessingForm extends UserOptionListForm { WCF::getSession()->checkPermissions(array('admin.user.canEditUser')); $userIDArray = $this->fetchUsers(function($userID, array $userData) { - $user = new UserEditor(new User(null, $row)); + $user = new UserEditor(new User(null, $row)); //TODO: undefined variable $user->addToGroups($this->assignToGroupIDArray, false, false); }); diff --git a/wcfsetup/install/files/lib/data/language/LanguageEditor.class.php b/wcfsetup/install/files/lib/data/language/LanguageEditor.class.php index 75293ad9b0..eef6cb8a88 100644 --- a/wcfsetup/install/files/lib/data/language/LanguageEditor.class.php +++ b/wcfsetup/install/files/lib/data/language/LanguageEditor.class.php @@ -546,10 +546,10 @@ class LanguageEditor extends DatabaseObjectEditor { // search and replace $matches = 0; if ($useRegex) { - $newValue = preg_replace('~'.$search.'~s'.(!$caseSensitive ? 'i' : ''), $replace, ($row['languageCustomItemValue'] ? $row['languageCustomItemValue'] : $row['languageItemValue']), -1, $matches); + $newValue = preg_replace('~'.$search.'~s'.(!$caseSensitive ? 'i' : ''), $replace, ($row['languageCustomItemValue'] ? $row['languageCustomItemValue'] : $row['languageItemValue']), -1, $matches); //TODO: undefined variable } else { - if ($caseSensitive) $newValue = StringUtil::replace($search, $replace, ($row['languageCustomItemValue'] ? $row['languageCustomItemValue'] : $row['languageItemValue']), $matches); + if ($caseSensitive) $newValue = StringUtil::replace($search, $replace, ($row['languageCustomItemValue'] ? $row['languageCustomItemValue'] : $row['languageItemValue']), $matches); //TODO: undefined variable else $newValue = StringUtil::replaceIgnoreCase($search, $replace, ($row['languageCustomItemValue'] ? $row['languageCustomItemValue'] : $row['languageItemValue']), $matches); } diff --git a/wcfsetup/install/files/lib/data/package/installation/queue/PackageInstallationQueueAction.class.php b/wcfsetup/install/files/lib/data/package/installation/queue/PackageInstallationQueueAction.class.php index 2bc80de6d8..c4ca751b8e 100644 --- a/wcfsetup/install/files/lib/data/package/installation/queue/PackageInstallationQueueAction.class.php +++ b/wcfsetup/install/files/lib/data/package/installation/queue/PackageInstallationQueueAction.class.php @@ -26,7 +26,7 @@ class PackageInstallationQueueAction extends AbstractDatabaseObjectAction { public function validatePrepareQueue() { if (isset($this->parameters['packageID'])) $this->packageID = intval($this->parameters['packageID']); - $this->package = new Package($packageID); + $this->package = new Package($packageID); //TODO: undefined variable if (!$this->package->packageID) { throw new ValidateActionException('Invalid package id'); } diff --git a/wcfsetup/install/files/lib/data/style/StyleEditor.class.php b/wcfsetup/install/files/lib/data/style/StyleEditor.class.php index 153a0a69f2..c95353e072 100644 --- a/wcfsetup/install/files/lib/data/style/StyleEditor.class.php +++ b/wcfsetup/install/files/lib/data/style/StyleEditor.class.php @@ -269,7 +269,7 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject $statement->execute(array($templateGroupName)); $row = $statement->fetchArray(); if (!$row['count']) break; - $templateGroupName = $originalTemplatePackName . '_' . $i; + $templateGroupName = $originalTemplatePackName . '_' . $i; //TODO: undefined variable $i++; } while (true); diff --git a/wcfsetup/install/files/lib/system/WCF.class.php b/wcfsetup/install/files/lib/system/WCF.class.php index d847b866a9..e298344b31 100644 --- a/wcfsetup/install/files/lib/system/WCF.class.php +++ b/wcfsetup/install/files/lib/system/WCF.class.php @@ -436,7 +436,7 @@ class WCF { } else { unset(self::$autoloadDirectories[$abbreviation]); - throw new exception\SystemException('Unable to run '.$row->package.', '.$className.' missing.'); + throw new exception\SystemException('Unable to run '.$row->package.', '.$className.' missing.'); //TODO: undefined variable } // load application settings if not within ACP diff --git a/wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php b/wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php index e1950f1bdc..1855e3abbd 100644 --- a/wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php +++ b/wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php @@ -51,7 +51,7 @@ class MySQLDatabaseEditor extends DatabaseEditor { $statement = $this->dbObj->prepareStatement($sql); $statement->execute(); while ($row = $statement->fetchArray()) { - $indices[] = $index['Key_name']; + $indices[] = $index['Key_name']; //TODO: undefined variable } return $indices; diff --git a/wcfsetup/install/files/lib/system/image/adapter/ImagickImageAdapter.class.php b/wcfsetup/install/files/lib/system/image/adapter/ImagickImageAdapter.class.php index 9db0a8dc31..ec08ee8254 100644 --- a/wcfsetup/install/files/lib/system/image/adapter/ImagickImageAdapter.class.php +++ b/wcfsetup/install/files/lib/system/image/adapter/ImagickImageAdapter.class.php @@ -52,7 +52,7 @@ class ImagickImageAdapter implements IImageAdapter { throw new SystemException("Object must be an instance of Imagick"); } - $this->imagick = $imagick; + $this->imagick = $imagick; //TODO: undefined variable $this->height = $this->imagick->getImageHeight(); $this->width = $this->imagick->getImageWidth(); } diff --git a/wcfsetup/install/files/lib/system/language/LanguageServerProcessor.class.php b/wcfsetup/install/files/lib/system/language/LanguageServerProcessor.class.php index fbeadcd120..4bc00b0de6 100644 --- a/wcfsetup/install/files/lib/system/language/LanguageServerProcessor.class.php +++ b/wcfsetup/install/files/lib/system/language/LanguageServerProcessor.class.php @@ -148,7 +148,7 @@ class LanguageServerProcessor extends SingletonFactory { // find location if (preg_match('/location:([^\n]*)/i', $header, $match)) { $location = trim($match[1]); - if ($location != $url) { + if ($location != $url) { //TODO: undefined variable $this->importLanguageFile($location, $packageList); return; } diff --git a/wcfsetup/install/files/lib/system/option/RadioButtonOptionType.class.php b/wcfsetup/install/files/lib/system/option/RadioButtonOptionType.class.php index 675438f03f..bcb0f10cc8 100644 --- a/wcfsetup/install/files/lib/system/option/RadioButtonOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/RadioButtonOptionType.class.php @@ -69,7 +69,7 @@ class RadioButtonOptionType extends AbstractOptionType implements ISearchableUse * @see wcf\system\option\ISearchableUserOption::getSearchFormElement() */ public function getSearchFormElement(Option $option, $value) { - return $this->getFormElement($optionData, $value); + return $this->getFormElement($optionData, $value); //TODO: undefined variable } /** diff --git a/wcfsetup/install/files/lib/system/option/SelectOptionType.class.php b/wcfsetup/install/files/lib/system/option/SelectOptionType.class.php index 14e1f74cbc..d773b61cac 100644 --- a/wcfsetup/install/files/lib/system/option/SelectOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/SelectOptionType.class.php @@ -35,7 +35,7 @@ class SelectOptionType extends RadioButtonOptionType { * @see wcf\system\option\ISearchableUserOption::getSearchFormElement() */ public function getSearchFormElement(Option $option, $value) { - return $this->getFormElement($optionData, $value); + return $this->getFormElement($optionData, $value); //TODO: undefined variable } /** diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationSQLParser.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationSQLParser.class.php index ff694f913b..ba4a40171a 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationSQLParser.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationSQLParser.class.php @@ -409,7 +409,7 @@ class PackageInstallationSQLParser extends SQLParser { */ protected function executeDropIndexStatement($tableName, $indexName) { if ($this->test) { - if ($ownerPackageID = $this->getIndexOwnerID($tableName, $columnName)) { + if ($ownerPackageID = $this->getIndexOwnerID($tableName, $columnName)) { //TODO: undefined variable if ($ownerPackageID != $this->package->packageID) { throw new SystemException("Can not drop index '.$indexName.'. A package can only drop own indices."); } diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationScheduler.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationScheduler.class.php index 7634aad80d..dc1c9b4882 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationScheduler.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationScheduler.class.php @@ -178,7 +178,7 @@ class PackageInstallationScheduler { $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); while ($row = $statement->fetchArray()) { - if (!isset($installedPackages[$row2['package']])) $installedPackages[$row2['package']] = array(); + if (!isset($installedPackages[$row2['package']])) $installedPackages[$row2['package']] = array(); //TODO: undefined variable $installedPackages[$row2['package']][$row2['packageID']] = (isset($this->virtualPackageVersions[$row2['packageID']]) ? $this->virtualPackageVersions[$row2['packageID']] : $row2['packageVersion']); } diff --git a/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php index 232589a0ad..b94a99a708 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php @@ -69,7 +69,7 @@ class ObjectTypePackageInstallationPlugin extends AbstractXMLPackageInstallation foreach ($items as $item) { $statement->execute(array( $item['attributes']['name'], - $this->getDefinitionID($data['elements']['definitionname']), + $this->getDefinitionID($data['elements']['definitionname']), //TODO: undefined variable $this->installation->getPackageID() )); } -- 2.20.1