Merge pull request #4537 from owncloud/no-realpath

Do not use realpath() on includes.
This commit is contained in:
Thomas Müller 2013-08-22 01:50:31 -07:00
commit 582b33bdf1
8 changed files with 76 additions and 76 deletions

View file

@ -25,7 +25,7 @@
namespace OCA\Encryption; namespace OCA\Encryption;
require_once realpath(dirname(__FILE__) . '/../3rdparty/Crypt_Blowfish/Blowfish.php'); require_once __DIR__ . '/../3rdparty/Crypt_Blowfish/Blowfish.php';
/** /**
* Class for common cryptography functionality * Class for common cryptography functionality

View file

@ -7,16 +7,16 @@
* See the COPYING-README file. * See the COPYING-README file.
*/ */
require_once realpath(dirname(__FILE__) . '/../3rdparty/Crypt_Blowfish/Blowfish.php'); require_once __DIR__ . '/../3rdparty/Crypt_Blowfish/Blowfish.php';
require_once realpath(dirname(__FILE__) . '/../../../lib/base.php'); require_once __DIR__ . '/../../../lib/base.php';
require_once realpath(dirname(__FILE__) . '/../lib/crypt.php'); require_once __DIR__ . '/../lib/crypt.php';
require_once realpath(dirname(__FILE__) . '/../lib/keymanager.php'); require_once __DIR__ . '/../lib/keymanager.php';
require_once realpath(dirname(__FILE__) . '/../lib/proxy.php'); require_once __DIR__ . '/../lib/proxy.php';
require_once realpath(dirname(__FILE__) . '/../lib/stream.php'); require_once __DIR__ . '/../lib/stream.php';
require_once realpath(dirname(__FILE__) . '/../lib/util.php'); require_once __DIR__ . '/../lib/util.php';
require_once realpath(dirname(__FILE__) . '/../lib/helper.php'); require_once __DIR__ . '/../lib/helper.php';
require_once realpath(dirname(__FILE__) . '/../appinfo/app.php'); require_once __DIR__ . '/../appinfo/app.php';
require_once realpath(dirname(__FILE__) . '/util.php'); require_once __DIR__ . '/util.php';
use OCA\Encryption; use OCA\Encryption;
@ -67,12 +67,12 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
$this->pass = \Test_Encryption_Crypt::TEST_ENCRYPTION_CRYPT_USER1; $this->pass = \Test_Encryption_Crypt::TEST_ENCRYPTION_CRYPT_USER1;
// set content for encrypting / decrypting in tests // set content for encrypting / decrypting in tests
$this->dataLong = file_get_contents(realpath(dirname(__FILE__) . '/../lib/crypt.php')); $this->dataLong = file_get_contents(__DIR__ . '/../lib/crypt.php');
$this->dataShort = 'hats'; $this->dataShort = 'hats';
$this->dataUrl = realpath(dirname(__FILE__) . '/../lib/crypt.php'); $this->dataUrl = __DIR__ . '/../lib/crypt.php';
$this->legacyData = realpath(dirname(__FILE__) . '/legacy-text.txt'); $this->legacyData = __DIR__ . '/legacy-text.txt';
$this->legacyEncryptedData = realpath(dirname(__FILE__) . '/legacy-encrypted-text.txt'); $this->legacyEncryptedData = __DIR__ . '/legacy-encrypted-text.txt';
$this->legacyEncryptedDataKey = realpath(dirname(__FILE__) . '/encryption.key'); $this->legacyEncryptedDataKey = __DIR__ . '/encryption.key';
$this->randomKey = Encryption\Crypt::generateKey(); $this->randomKey = Encryption\Crypt::generateKey();
$keypair = Encryption\Crypt::createKeypair(); $keypair = Encryption\Crypt::createKeypair();

View file

@ -6,15 +6,15 @@
* See the COPYING-README file. * See the COPYING-README file.
*/ */
require_once realpath(dirname(__FILE__) . '/../../../lib/base.php'); require_once __DIR__ . '/../../../lib/base.php';
require_once realpath(dirname(__FILE__) . '/../lib/crypt.php'); require_once __DIR__ . '/../lib/crypt.php';
require_once realpath(dirname(__FILE__) . '/../lib/keymanager.php'); require_once __DIR__ . '/../lib/keymanager.php';
require_once realpath(dirname(__FILE__) . '/../lib/proxy.php'); require_once __DIR__ . '/../lib/proxy.php';
require_once realpath(dirname(__FILE__) . '/../lib/stream.php'); require_once __DIR__ . '/../lib/stream.php';
require_once realpath(dirname(__FILE__) . '/../lib/util.php'); require_once __DIR__ . '/../lib/util.php';
require_once realpath(dirname(__FILE__) . '/../lib/helper.php'); require_once __DIR__ . '/../lib/helper.php';
require_once realpath(dirname(__FILE__) . '/../appinfo/app.php'); require_once __DIR__ . '/../appinfo/app.php';
require_once realpath(dirname(__FILE__) . '/util.php'); require_once __DIR__ . '/util.php';
use OCA\Encryption; use OCA\Encryption;
@ -57,11 +57,11 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase {
function setUp() { function setUp() {
// set content for encrypting / decrypting in tests // set content for encrypting / decrypting in tests
$this->dataLong = file_get_contents(realpath(dirname(__FILE__) . '/../lib/crypt.php')); $this->dataLong = file_get_contents(__DIR__ . '/../lib/crypt.php');
$this->dataShort = 'hats'; $this->dataShort = 'hats';
$this->dataUrl = realpath(dirname(__FILE__) . '/../lib/crypt.php'); $this->dataUrl = __DIR__ . '/../lib/crypt.php';
$this->legacyData = realpath(dirname(__FILE__) . '/legacy-text.txt'); $this->legacyData = __DIR__ . '/legacy-text.txt';
$this->legacyEncryptedData = realpath(dirname(__FILE__) . '/legacy-encrypted-text.txt'); $this->legacyEncryptedData = __DIR__ . '/legacy-encrypted-text.txt';
$this->randomKey = Encryption\Crypt::generateKey(); $this->randomKey = Encryption\Crypt::generateKey();
$keypair = Encryption\Crypt::createKeypair(); $keypair = Encryption\Crypt::createKeypair();

View file

@ -20,16 +20,16 @@
* *
*/ */
require_once realpath(dirname(__FILE__) . '/../3rdparty/Crypt_Blowfish/Blowfish.php'); require_once __DIR__ . '/../3rdparty/Crypt_Blowfish/Blowfish.php';
require_once realpath(dirname(__FILE__) . '/../../../lib/base.php'); require_once __DIR__ . '/../../../lib/base.php';
require_once realpath(dirname(__FILE__) . '/../lib/crypt.php'); require_once __DIR__ . '/../lib/crypt.php';
require_once realpath(dirname(__FILE__) . '/../lib/keymanager.php'); require_once __DIR__ . '/../lib/keymanager.php';
require_once realpath(dirname(__FILE__) . '/../lib/proxy.php'); require_once __DIR__ . '/../lib/proxy.php';
require_once realpath(dirname(__FILE__) . '/../lib/stream.php'); require_once __DIR__ . '/../lib/stream.php';
require_once realpath(dirname(__FILE__) . '/../lib/util.php'); require_once __DIR__ . '/../lib/util.php';
require_once realpath(dirname(__FILE__) . '/../lib/helper.php'); require_once __DIR__ . '/../lib/helper.php';
require_once realpath(dirname(__FILE__) . '/../appinfo/app.php'); require_once __DIR__ . '/../appinfo/app.php';
require_once realpath(dirname(__FILE__) . '/util.php'); require_once __DIR__ . '/util.php';
use OCA\Encryption; use OCA\Encryption;

View file

@ -20,14 +20,14 @@
* *
*/ */
require_once realpath(dirname(__FILE__) . '/../../../lib/base.php'); require_once __DIR__ . '/../../../lib/base.php';
require_once realpath(dirname(__FILE__) . '/../lib/crypt.php'); require_once __DIR__ . '/../lib/crypt.php';
require_once realpath(dirname(__FILE__) . '/../lib/keymanager.php'); require_once __DIR__ . '/../lib/keymanager.php';
require_once realpath(dirname(__FILE__) . '/../lib/proxy.php'); require_once __DIR__ . '/../lib/proxy.php';
require_once realpath(dirname(__FILE__) . '/../lib/stream.php'); require_once __DIR__ . '/../lib/stream.php';
require_once realpath(dirname(__FILE__) . '/../lib/util.php'); require_once __DIR__ . '/../lib/util.php';
require_once realpath(dirname(__FILE__) . '/../appinfo/app.php'); require_once __DIR__ . '/../appinfo/app.php';
require_once realpath(dirname(__FILE__) . '/util.php'); require_once __DIR__ . '/util.php';
use OCA\Encryption; use OCA\Encryption;

View file

@ -20,15 +20,15 @@
* *
*/ */
require_once realpath(dirname(__FILE__) . '/../../../lib/base.php'); require_once __DIR__ . '/../../../lib/base.php';
require_once realpath(dirname(__FILE__) . '/../lib/crypt.php'); require_once __DIR__ . '/../lib/crypt.php';
require_once realpath(dirname(__FILE__) . '/../lib/keymanager.php'); require_once __DIR__ . '/../lib/keymanager.php';
require_once realpath(dirname(__FILE__) . '/../lib/proxy.php'); require_once __DIR__ . '/../lib/proxy.php';
require_once realpath(dirname(__FILE__) . '/../lib/stream.php'); require_once __DIR__ . '/../lib/stream.php';
require_once realpath(dirname(__FILE__) . '/../lib/util.php'); require_once __DIR__ . '/../lib/util.php';
require_once realpath(dirname(__FILE__) . '/../appinfo/app.php'); require_once __DIR__ . '/../appinfo/app.php';
require_once realpath(dirname(__FILE__) . '/../../files_trashbin/appinfo/app.php'); require_once __DIR__ . '/../../files_trashbin/appinfo/app.php';
require_once realpath(dirname(__FILE__) . '/util.php'); require_once __DIR__ . '/util.php';
use OCA\Encryption; use OCA\Encryption;

View file

@ -6,13 +6,13 @@
* See the COPYING-README file. * See the COPYING-README file.
*/ */
require_once realpath(dirname(__FILE__) . '/../../../lib/base.php'); require_once __DIR__ . '/../../../lib/base.php';
require_once realpath(dirname(__FILE__) . '/../lib/crypt.php'); require_once __DIR__ . '/../lib/crypt.php';
require_once realpath(dirname(__FILE__) . '/../lib/keymanager.php'); require_once __DIR__ . '/../lib/keymanager.php';
require_once realpath(dirname(__FILE__) . '/../lib/proxy.php'); require_once __DIR__ . '/../lib/proxy.php';
require_once realpath(dirname(__FILE__) . '/../lib/stream.php'); require_once __DIR__ . '/../lib/stream.php';
require_once realpath(dirname(__FILE__) . '/../lib/util.php'); require_once __DIR__ . '/../lib/util.php';
require_once realpath(dirname(__FILE__) . '/../appinfo/app.php'); require_once __DIR__ . '/../appinfo/app.php';
use OCA\Encryption; use OCA\Encryption;
@ -69,12 +69,12 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
$this->pass = \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_USER1; $this->pass = \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_USER1;
// set content for encrypting / decrypting in tests // set content for encrypting / decrypting in tests
$this->dataUrl = realpath(dirname(__FILE__) . '/../lib/crypt.php'); $this->dataUrl = __DIR__ . '/../lib/crypt.php';
$this->dataShort = 'hats'; $this->dataShort = 'hats';
$this->dataLong = file_get_contents(realpath(dirname(__FILE__) . '/../lib/crypt.php')); $this->dataLong = file_get_contents(__DIR__ . '/../lib/crypt.php');
$this->legacyData = realpath(dirname(__FILE__) . '/legacy-text.txt'); $this->legacyData = __DIR__ . '/legacy-text.txt';
$this->legacyEncryptedData = realpath(dirname(__FILE__) . '/legacy-encrypted-text.txt'); $this->legacyEncryptedData = __DIR__ . '/legacy-encrypted-text.txt';
$this->legacyEncryptedDataKey = realpath(dirname(__FILE__) . '/encryption.key'); $this->legacyEncryptedDataKey = __DIR__ . '/encryption.key';
$this->legacyKey = "30943623843030686906\0\0\0\0"; $this->legacyKey = "30943623843030686906\0\0\0\0";
$keypair = Encryption\Crypt::createKeypair(); $keypair = Encryption\Crypt::createKeypair();

View file

@ -20,14 +20,14 @@
* *
*/ */
require_once realpath(dirname(__FILE__) . '/../../../lib/base.php'); require_once __DIR__ . '/../../../lib/base.php';
require_once realpath(dirname(__FILE__) . '/../lib/crypt.php'); require_once __DIR__ . '/../lib/crypt.php';
require_once realpath(dirname(__FILE__) . '/../lib/keymanager.php'); require_once __DIR__ . '/../lib/keymanager.php';
require_once realpath(dirname(__FILE__) . '/../lib/proxy.php'); require_once __DIR__ . '/../lib/proxy.php';
require_once realpath(dirname(__FILE__) . '/../lib/stream.php'); require_once __DIR__ . '/../lib/stream.php';
require_once realpath(dirname(__FILE__) . '/../lib/util.php'); require_once __DIR__ . '/../lib/util.php';
require_once realpath(dirname(__FILE__) . '/../appinfo/app.php'); require_once __DIR__ . '/../appinfo/app.php';
require_once realpath(dirname(__FILE__) . '/util.php'); require_once __DIR__ . '/util.php';
use OCA\Encryption; use OCA\Encryption;