diff options
-rw-r--r-- | apps/dav/lib/connector/sabre/file.php | 10 | ||||
-rw-r--r-- | apps/files_external/service/dbconfigservice.php | 36 | ||||
-rw-r--r-- | apps/files_external/tests/service/dbconfigservicetest.php | 2 | ||||
-rw-r--r-- | apps/files_external/tests/service/storagesservicetest.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/api/remote.php | 8 | ||||
-rw-r--r-- | apps/files_sharing/api/server2server.php | 7 | ||||
-rw-r--r-- | apps/files_sharing/lib/activity.php | 93 | ||||
-rw-r--r-- | apps/files_sharing/lib/external/manager.php | 6 | ||||
-rw-r--r-- | console.php | 2 | ||||
-rw-r--r-- | lib/private/app.php | 11 | ||||
-rw-r--r-- | lib/private/app/appmanager.php | 3 | ||||
-rw-r--r-- | lib/private/app/codechecker/infochecker.php | 17 | ||||
-rw-r--r-- | lib/private/helper.php | 3 | ||||
-rw-r--r-- | lib/private/installer.php | 9 | ||||
-rw-r--r-- | lib/private/share20/manager.php | 2 | ||||
-rw-r--r-- | lib/private/share20/share.php | 11 | ||||
-rw-r--r-- | lib/public/app.php | 2 | ||||
-rw-r--r-- | tests/data/testapp.zip | bin | 895 -> 689 bytes | |||
-rw-r--r-- | tests/data/testapp2.zip | bin | 2449 -> 2240 bytes | |||
-rw-r--r-- | tests/lib/app/codechecker/infocheckertest.php | 2 |
20 files changed, 159 insertions, 67 deletions
diff --git a/apps/dav/lib/connector/sabre/file.php b/apps/dav/lib/connector/sabre/file.php index be313a91e8c..38a1ee5f4e2 100644 --- a/apps/dav/lib/connector/sabre/file.php +++ b/apps/dav/lib/connector/sabre/file.php @@ -194,15 +194,15 @@ class File extends Node implements IFile { } } + // since we skipped the view we need to scan and emit the hooks ourselves + $storage->getUpdater()->update($internalPath); + try { $this->changeLock(ILockingProvider::LOCK_SHARED); } catch (LockedException $e) { throw new FileLocked($e->getMessage(), $e->getCode(), $e); } - // since we skipped the view we need to scan and emit the hooks ourselves - $storage->getUpdater()->update($internalPath); - if ($view) { $this->emitPostHooks($exists); } @@ -450,11 +450,11 @@ class File extends Node implements IFile { } } - $this->fileView->changeLock($targetPath, ILockingProvider::LOCK_SHARED); - // since we skipped the view we need to scan and emit the hooks ourselves $targetStorage->getUpdater()->update($targetInternalPath); + $this->fileView->changeLock($targetPath, ILockingProvider::LOCK_SHARED); + $this->emitPostHooks($exists, $targetPath); $info = $this->fileView->getFileInfo($targetPath); diff --git a/apps/files_external/service/dbconfigservice.php b/apps/files_external/service/dbconfigservice.php index d52bf51e4aa..07f9942e05c 100644 --- a/apps/files_external/service/dbconfigservice.php +++ b/apps/files_external/service/dbconfigservice.php @@ -23,6 +23,7 @@ namespace OCA\Files_External\Service; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; +use OCP\Security\ICrypto; /** * Stores the mount config in the database @@ -41,12 +42,19 @@ class DBConfigService { private $connection; /** + * @var ICrypto + */ + private $crypto; + + /** * DBConfigService constructor. * * @param IDBConnection $connection + * @param ICrypto $crypto */ - public function __construct(IDBConnection $connection) { + public function __construct(IDBConnection $connection, ICrypto $crypto) { $this->connection = $connection; + $this->crypto = $crypto; } /** @@ -246,6 +254,9 @@ class DBConfigService { * @param string $value */ public function setConfig($mountId, $key, $value) { + if ($key === 'password') { + $value = $this->encryptValue($value); + } $count = $this->connection->insertIfNotExist('*PREFIX*external_config', [ 'mount_id' => $mountId, 'key' => $key, @@ -267,6 +278,7 @@ class DBConfigService { * @param string $value */ public function setOption($mountId, $key, $value) { + $count = $this->connection->insertIfNotExist('*PREFIX*external_options', [ 'mount_id' => $mountId, 'key' => $key, @@ -398,13 +410,31 @@ class DBConfigService { * @return array ['key1' => $value1, ...] */ private function createKeyValueMap(array $keyValuePairs) { + $decryptedPairts = array_map(function ($pair) { + if ($pair['key'] === 'password') { + $pair['value'] = $this->decryptValue($pair['value']); + } + return $pair; + }, $keyValuePairs); $keys = array_map(function ($pair) { return $pair['key']; - }, $keyValuePairs); + }, $decryptedPairts); $values = array_map(function ($pair) { return $pair['value']; - }, $keyValuePairs); + }, $decryptedPairts); return array_combine($keys, $values); } + + private function encryptValue($value) { + return $this->crypto->encrypt($value); + } + + private function decryptValue($value) { + try { + return $this->crypto->decrypt($value); + } catch (\Exception $e) { + return $value; + } + } } diff --git a/apps/files_external/tests/service/dbconfigservicetest.php b/apps/files_external/tests/service/dbconfigservicetest.php index 41b5df73613..30c67ac8c93 100644 --- a/apps/files_external/tests/service/dbconfigservicetest.php +++ b/apps/files_external/tests/service/dbconfigservicetest.php @@ -45,7 +45,7 @@ class DBConfigServiceTest extends TestCase { public function setUp() { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); - $this->dbConfig = new DBConfigService($this->connection); + $this->dbConfig = new DBConfigService($this->connection, \OC::$server->getCrypto()); } public function tearDown() { diff --git a/apps/files_external/tests/service/storagesservicetest.php b/apps/files_external/tests/service/storagesservicetest.php index 68671b599bd..3fbe3b755e1 100644 --- a/apps/files_external/tests/service/storagesservicetest.php +++ b/apps/files_external/tests/service/storagesservicetest.php @@ -83,7 +83,7 @@ abstract class StoragesServiceTest extends \Test\TestCase { public function setUp() { parent::setUp(); - $this->dbConfig = new CleaningDBConfig(\OC::$server->getDatabaseConnection()); + $this->dbConfig = new CleaningDBConfig(\OC::$server->getDatabaseConnection(), \OC::$server->getCrypto()); self::$hookCalls = array(); $config = \OC::$server->getConfig(); $this->dataDir = $config->getSystemValue( diff --git a/apps/files_sharing/api/remote.php b/apps/files_sharing/api/remote.php index 4b7192994a7..8b47955b51e 100644 --- a/apps/files_sharing/api/remote.php +++ b/apps/files_sharing/api/remote.php @@ -67,6 +67,9 @@ class Remote { return new \OC_OCS_Result(); } + // Make sure the user has no notification for something that does not exist anymore. + $externalManager->processNotification((int) $params['id']); + return new \OC_OCS_Result(null, 404, "wrong share ID, share doesn't exist."); } @@ -90,12 +93,15 @@ class Remote { return new \OC_OCS_Result(); } + // Make sure the user has no notification for something that does not exist anymore. + $externalManager->processNotification((int) $params['id']); + return new \OC_OCS_Result(null, 404, "wrong share ID, share doesn't exist."); } /** * @param array $share Share with info from the share_external table - * @return enriched share info with data from the filecache + * @return array enriched share info with data from the filecache */ private static function extendShareInfo($share) { $view = new \OC\Files\View('/' . \OC_User::getUser() . '/files/'); diff --git a/apps/files_sharing/api/server2server.php b/apps/files_sharing/api/server2server.php index a27b3a3bd85..f04ddc81b84 100644 --- a/apps/files_sharing/api/server2server.php +++ b/apps/files_sharing/api/server2server.php @@ -225,6 +225,13 @@ class Server2Server { $path = trim($share['name'], '/'); } + $notificationManager = \OC::$server->getNotificationManager(); + $notification = $notificationManager->createNotification(); + $notification->setApp('files_sharing') + ->setUser($share['user']) + ->setObject('remote_share', (int) $share['id']); + $notificationManager->markProcessed($notification); + \OC::$server->getActivityManager()->publishActivity( Activity::FILES_SHARING_APP, Activity::SUBJECT_REMOTE_SHARE_UNSHARED, array($owner, $path), '', array(), '', '', $user, Activity::TYPE_REMOTE_SHARE, Activity::PRIORITY_MEDIUM); diff --git a/apps/files_sharing/lib/activity.php b/apps/files_sharing/lib/activity.php index 37a8113b916..721379eb78f 100644 --- a/apps/files_sharing/lib/activity.php +++ b/apps/files_sharing/lib/activity.php @@ -54,14 +54,26 @@ class Activity implements IExtension { const SUBJECT_REMOTE_SHARE_RECEIVED = 'remote_share_received'; const SUBJECT_REMOTE_SHARE_UNSHARED = 'remote_share_unshared'; - const SUBJECT_SHARED_GROUP_SELF = 'shared_group_self'; - const SUBJECT_SHARED_LINK_SELF = 'shared_link_self'; const SUBJECT_SHARED_USER_SELF = 'shared_user_self'; + const SUBJECT_RESHARED_USER_BY = 'reshared_user_by'; + const SUBJECT_UNSHARED_USER_SELF = 'unshared_user_self'; + const SUBJECT_UNSHARED_USER_BY = 'unshared_user_by'; + + const SUBJECT_SHARED_GROUP_SELF = 'shared_group_self'; const SUBJECT_RESHARED_GROUP_BY = 'reshared_group_by'; + const SUBJECT_UNSHARED_GROUP_SELF = 'unshared_group_self'; + const SUBJECT_UNSHARED_GROUP_BY = 'unshared_group_by'; + + const SUBJECT_SHARED_LINK_SELF = 'shared_link_self'; const SUBJECT_RESHARED_LINK_BY = 'reshared_link_by'; - const SUBJECT_RESHARED_USER_BY = 'reshared_user_by'; + const SUBJECT_UNSHARED_LINK_SELF = 'unshared_link_self'; + const SUBJECT_UNSHARED_LINK_BY = 'unshared_link_by'; + const SUBJECT_LINK_EXPIRED = 'link_expired'; + const SUBJECT_LINK_BY_EXPIRED = 'link_by_expired'; + const SUBJECT_SHARED_EMAIL = 'shared_with_email'; const SUBJECT_SHARED_WITH_BY = 'shared_with_by'; + const SUBJECT_UNSHARED_BY = 'unshared_by'; /** @var IFactory */ protected $languageFactory; @@ -197,20 +209,42 @@ class Activity implements IExtension { return (string) $l->t('Public shared folder %1$s was downloaded', $params); case self::SUBJECT_PUBLIC_SHARED_FILE_DOWNLOADED: return (string) $l->t('Public shared file %1$s was downloaded', $params); + case self::SUBJECT_SHARED_USER_SELF: return (string) $l->t('You shared %1$s with %2$s', $params); - case self::SUBJECT_SHARED_GROUP_SELF: - return (string) $l->t('You shared %1$s with group %2$s', $params); case self::SUBJECT_RESHARED_USER_BY: return (string) $l->t('%2$s shared %1$s with %3$s', $params); + case self::SUBJECT_UNSHARED_USER_SELF: + return (string) $l->t('You removed the share of %2$s for %1$s', $params); + case self::SUBJECT_UNSHARED_USER_BY: + return (string) $l->t('%2$s removed the share of %3$s for %1$s', $params); + + case self::SUBJECT_SHARED_GROUP_SELF: + return (string) $l->t('You shared %1$s with group %2$s', $params); case self::SUBJECT_RESHARED_GROUP_BY: return (string) $l->t('%2$s shared %1$s with group %3$s', $params); + case self::SUBJECT_UNSHARED_GROUP_SELF: + return (string) $l->t('You removed the share of group %2$s for %1$s', $params); + case self::SUBJECT_UNSHARED_GROUP_BY: + return (string) $l->t('%2$s removed the share of group %3$s for %1$s', $params); + case self::SUBJECT_RESHARED_LINK_BY: return (string) $l->t('%2$s shared %1$s via link', $params); - case self::SUBJECT_SHARED_WITH_BY: - return (string) $l->t('%2$s shared %1$s with you', $params); case self::SUBJECT_SHARED_LINK_SELF: return (string) $l->t('You shared %1$s via link', $params); + case self::SUBJECT_UNSHARED_LINK_SELF: + return (string) $l->t('You removed the public link for %1$s', $params); + case self::SUBJECT_UNSHARED_LINK_BY: + return (string) $l->t('%2$s removed the public link for %1$s', $params); + case self::SUBJECT_LINK_EXPIRED: + return (string) $l->t('Your public link for %1$s expired', $params); + case self::SUBJECT_LINK_BY_EXPIRED: + return (string) $l->t('The public link of %2$s for %1$s expired', $params); + + case self::SUBJECT_SHARED_WITH_BY: + return (string) $l->t('%2$s shared %1$s with you', $params); + case self::SUBJECT_UNSHARED_BY: + return (string) $l->t('%2$s removed the share for %1$s', $params); case self::SUBJECT_SHARED_EMAIL: return (string) $l->t('You shared %1$s with %2$s', $params); } @@ -229,20 +263,40 @@ class Activity implements IExtension { case self::SUBJECT_PUBLIC_SHARED_FOLDER_DOWNLOADED: case self::SUBJECT_PUBLIC_SHARED_FILE_DOWNLOADED: return (string) $l->t('Downloaded via public link'); + case self::SUBJECT_SHARED_USER_SELF: return (string) $l->t('Shared with %2$s', $params); - case self::SUBJECT_SHARED_GROUP_SELF: - return (string) $l->t('Shared with group %2$s', $params); case self::SUBJECT_RESHARED_USER_BY: return (string) $l->t('Shared with %3$s by %2$s', $params); + case self::SUBJECT_UNSHARED_USER_SELF: + return (string) $l->t('Removed share for %2$s', $params); + case self::SUBJECT_UNSHARED_USER_BY: + return (string) $l->t('%2$s removed share for %3$s', $params); + + case self::SUBJECT_SHARED_GROUP_SELF: + return (string) $l->t('Shared with group %2$s', $params); case self::SUBJECT_RESHARED_GROUP_BY: return (string) $l->t('Shared with group %3$s by %2$s', $params); + case self::SUBJECT_UNSHARED_GROUP_SELF: + return (string) $l->t('Removed share of group %2$s', $params); + case self::SUBJECT_UNSHARED_GROUP_BY: + return (string) $l->t('%2$s removed share of group %3$s', $params); + case self::SUBJECT_RESHARED_LINK_BY: return (string) $l->t('Shared via link by %2$s', $params); - case self::SUBJECT_SHARED_WITH_BY: - return (string) $l->t('Shared by %2$s', $params); case self::SUBJECT_SHARED_LINK_SELF: return (string) $l->t('Shared via public link'); + case self::SUBJECT_UNSHARED_LINK_SELF: + return (string) $l->t('Removed public link'); + case self::SUBJECT_UNSHARED_LINK_BY: + return (string) $l->t('%2$s removed public link'); + case self::SUBJECT_LINK_EXPIRED: + return (string) $l->t('Public link expired', $params); + case self::SUBJECT_LINK_BY_EXPIRED: + return (string) $l->t('Public link of %2$s expired', $params); + + case self::SUBJECT_SHARED_WITH_BY: + return (string) $l->t('Shared by %2$s', $params); case self::SUBJECT_SHARED_EMAIL: return (string) $l->t('Shared with %2$s', $params); @@ -283,6 +337,8 @@ class Activity implements IExtension { 0 => 'file', ); case self::SUBJECT_SHARED_LINK_SELF: + case self::SUBJECT_UNSHARED_LINK_SELF: + case self::SUBJECT_LINK_EXPIRED: return [0 => 'file']; case self::SUBJECT_RESHARED_LINK_BY: return [ @@ -298,8 +354,13 @@ class Activity implements IExtension { case self::SUBJECT_SHARED_USER_SELF: case self::SUBJECT_SHARED_WITH_BY: + case self::SUBJECT_UNSHARED_BY: + case self::SUBJECT_UNSHARED_LINK_BY: + case self::SUBJECT_LINK_BY_EXPIRED: + case self::SUBJECT_UNSHARED_USER_SELF: return [0 => 'file', 1 => 'username']; case self::SUBJECT_RESHARED_USER_BY: + case self::SUBJECT_UNSHARED_USER_BY: return [ 0 => 'file', 1 => 'username', @@ -307,12 +368,14 @@ class Activity implements IExtension { ]; case self::SUBJECT_SHARED_GROUP_SELF: + case self::SUBJECT_UNSHARED_GROUP_SELF: return [ 0 => 'file', 1 => 'group', ]; case self::SUBJECT_RESHARED_GROUP_BY: + case self::SUBJECT_UNSHARED_GROUP_BY: return [ 0 => 'file', 1 => 'username', @@ -335,18 +398,16 @@ class Activity implements IExtension { if ($activity['app'] === self::FILES_SHARING_APP) { switch ($activity['subject']) { case self::SUBJECT_SHARED_LINK_SELF: + case self::SUBJECT_UNSHARED_LINK_SELF: + case self::SUBJECT_LINK_EXPIRED: case self::SUBJECT_SHARED_WITH_BY: + case self::SUBJECT_UNSHARED_BY: // Group by file name return 0; case self::SUBJECT_SHARED_USER_SELF: case self::SUBJECT_SHARED_GROUP_SELF: // Group by user/group return 1; - case self::SUBJECT_RESHARED_USER_BY: - case self::SUBJECT_RESHARED_GROUP_BY: - // Group by user/group - // FIXME: Grouping does currently not work with more then 2 parameters - // return 2; } } diff --git a/apps/files_sharing/lib/external/manager.php b/apps/files_sharing/lib/external/manager.php index 21729d326e5..84de1da69f6 100644 --- a/apps/files_sharing/lib/external/manager.php +++ b/apps/files_sharing/lib/external/manager.php @@ -194,7 +194,7 @@ class Manager { \OC_Hook::emit('OCP\Share', 'federated_share_added', ['server' => $share['remote']]); - $this->scrapNotification($id); + $this->processNotification($id); return true; } @@ -217,7 +217,7 @@ class Manager { $removeShare->execute(array($id, $this->uid)); $this->sendFeedbackToRemote($share['remote'], $share['share_token'], $share['remote_id'], 'decline'); - $this->scrapNotification($id); + $this->processNotification($id); return true; } @@ -227,7 +227,7 @@ class Manager { /** * @param int $remoteShare */ - protected function scrapNotification($remoteShare) { + public function processNotification($remoteShare) { $filter = $this->notificationManager->createNotification(); $filter->setApp('files_sharing') ->setUser($this->uid) diff --git a/console.php b/console.php index d08d400c051..d8c23d4ce00 100644 --- a/console.php +++ b/console.php @@ -72,7 +72,7 @@ try { echo "Can't determine current working dir - the script will continue to work but be aware of the above fact." . PHP_EOL; } else if ($oldWorkingDir !== __DIR__ && !chdir(__DIR__)) { echo "This script can be run from the ownCloud root directory only." . PHP_EOL; - echo "Can't change to ownCloud root diretory." . PHP_EOL; + echo "Can't change to ownCloud root directory." . PHP_EOL; exit(1); } diff --git a/lib/private/app.php b/lib/private/app.php index 2abc015a91f..3df3a0e5bac 100644 --- a/lib/private/app.php +++ b/lib/private/app.php @@ -564,7 +564,7 @@ class OC_App { } /** - * get the last version of the app, either from appinfo/version or from appinfo/info.xml + * get the last version of the app from appinfo/info.xml * * @param string $appId * @return string @@ -584,14 +584,9 @@ class OC_App { * @return string */ public static function getAppVersionByPath($path) { - $versionFile = $path . '/appinfo/version'; $infoFile = $path . '/appinfo/info.xml'; - if (is_file($versionFile)) { - return trim(file_get_contents($versionFile)); - } else { - $appData = self::getAppInfo($infoFile, true); - return isset($appData['version']) ? $appData['version'] : ''; - } + $appData = self::getAppInfo($infoFile, true); + return isset($appData['version']) ? $appData['version'] : ''; } diff --git a/lib/private/app/appmanager.php b/lib/private/app/appmanager.php index eeb2216d5a8..4855f6f0185 100644 --- a/lib/private/app/appmanager.php +++ b/lib/private/app/appmanager.php @@ -297,9 +297,6 @@ class AppManager implements IAppManager { /** * Returns the app information from "appinfo/info.xml". * - * If no version was present in "appinfo/info.xml", reads it - * from the external "appinfo/version" file instead. - * * @param string $appId app id * * @return array app iinfo diff --git a/lib/private/app/codechecker/infochecker.php b/lib/private/app/codechecker/infochecker.php index ac92ee2661c..812007d8839 100644 --- a/lib/private/app/codechecker/infochecker.php +++ b/lib/private/app/codechecker/infochecker.php @@ -41,21 +41,22 @@ class InfoChecker extends BasicEmitter { 'bugs', 'category', 'default_enable', - 'dependencies', + 'dependencies', // TODO: Mandatory as of ownCloud 11 'documentation', 'namespace', 'ocsid', 'public', 'remote', 'repository', - 'require', - 'requiremin', 'types', 'version', 'website', ]; private $deprecatedFields = [ 'info', + 'require', + 'requiremax', + 'requiremin', 'shipped', 'standalone', ]; @@ -137,7 +138,7 @@ class InfoChecker extends BasicEmitter { $versionFile = $appPath . '/appinfo/version'; if (is_file($versionFile)) { $version = trim(file_get_contents($versionFile)); - if(isset($info['version'])) { + if (isset($info['version'])) { if($info['version'] !== $version) { $this->emit('InfoChecker', 'differentVersions', [$version, $info['version']]); @@ -152,14 +153,6 @@ class InfoChecker extends BasicEmitter { } else { $this->emit('InfoChecker', 'migrateVersion', [$version]); } - } else { - if(!isset($info['version'])) { - $this->emit('InfoChecker', 'mandatoryFieldMissing', ['version']); - $errors[] = [ - 'type' => 'mandatoryFieldMissing', - 'field' => 'version', - ]; - } } return $errors; diff --git a/lib/private/helper.php b/lib/private/helper.php index 495f95e72d2..23068330f81 100644 --- a/lib/private/helper.php +++ b/lib/private/helper.php @@ -583,7 +583,8 @@ class OC_Helper { } } } - $memcache->set($program, $result, 3600); + // store the value for 5 minutes + $memcache->set($program, $result, 300); return $result; } diff --git a/lib/private/installer.php b/lib/private/installer.php index f30db9ca659..1e4bb968929 100644 --- a/lib/private/installer.php +++ b/lib/private/installer.php @@ -390,16 +390,11 @@ class OC_Installer{ } // check if the ocs version is the same as the version in info.xml/version - $versionFile= $extractDir.'/appinfo/version'; - if(is_file($versionFile)) { - $version = trim(file_get_contents($versionFile)); - }else{ - $version = trim($info['version']); - } + $version = trim($info['version']); if(isset($data['appdata']['version']) && $version<>trim($data['appdata']['version'])) { OC_Helper::rmdirr($extractDir); - throw new \Exception($l->t("App can't be installed because the version in info.xml/version is not the same as the version reported from the app store")); + throw new \Exception($l->t("App can't be installed because the version in info.xml is not the same as the version reported from the app store")); } return $info; diff --git a/lib/private/share20/manager.php b/lib/private/share20/manager.php index c13bf965676..4345784d2e7 100644 --- a/lib/private/share20/manager.php +++ b/lib/private/share20/manager.php @@ -720,7 +720,7 @@ class Manager implements IManager { 'itemSource' => $share->getNodeId(), 'shareType' => $shareType, 'shareWith' => $sharedWith, - 'itemparent' => $share->getParent(), + 'itemparent' => method_exists($share, 'getParent') ? $share->getParent() : '', 'uidOwner' => $share->getSharedBy(), 'fileSource' => $share->getNodeId(), 'fileTarget' => $share->getTarget() diff --git a/lib/private/share20/share.php b/lib/private/share20/share.php index 323d8c8e8ab..6edd0e6886a 100644 --- a/lib/private/share20/share.php +++ b/lib/private/share20/share.php @@ -321,7 +321,11 @@ class Share implements \OCP\Share\IShare { } /** - * @inheritdoc + * Set the parent of this share + * + * @param int parent + * @return \OCP\Share\IShare + * @deprecated The new shares do not have parents. This is just here for legacy reasons. */ public function setParent($parent) { $this->parent = $parent; @@ -329,7 +333,10 @@ class Share implements \OCP\Share\IShare { } /** - * @inheritdoc + * Get the parent of this share. + * + * @return int + * @deprecated The new shares do not have parents. This is just here for legacy reasons. */ public function getParent() { return $this->parent; diff --git a/lib/public/app.php b/lib/public/app.php index e25f025d12d..032116eb43f 100644 --- a/lib/public/app.php +++ b/lib/public/app.php @@ -142,7 +142,7 @@ class App { } /** - * Get the last version of the app, either from appinfo/version or from appinfo/info.xml + * Get the last version of the app from appinfo/info.xml * @param string $app * @return string * @since 4.0.0 diff --git a/tests/data/testapp.zip b/tests/data/testapp.zip Binary files differindex e76c0d18724..c828572827f 100644 --- a/tests/data/testapp.zip +++ b/tests/data/testapp.zip diff --git a/tests/data/testapp2.zip b/tests/data/testapp2.zip Binary files differindex f46832f7a75..1953cc896f8 100644 --- a/tests/data/testapp2.zip +++ b/tests/data/testapp2.zip diff --git a/tests/lib/app/codechecker/infocheckertest.php b/tests/lib/app/codechecker/infocheckertest.php index 59c1316b769..b31c5fe3a7a 100644 --- a/tests/lib/app/codechecker/infocheckertest.php +++ b/tests/lib/app/codechecker/infocheckertest.php @@ -54,7 +54,7 @@ class InfoCheckerTest extends TestCase { ['testapp-version', []], ['testapp-infoxml-version', []], ['testapp-infoxml-version-different', [['type' => 'differentVersions', 'message' => 'appinfo/version: 1.2.4 - appinfo/info.xml: 1.2.3']]], - ['testapp-version-missing', [['type' => 'mandatoryFieldMissing', 'field' => 'version']]], + ['testapp-version-missing', []], ['testapp-name-missing', [['type' => 'mandatoryFieldMissing', 'field' => 'name']]], ]; } |