]> source.dussan.org Git - nextcloud-server.git/commitdiff
Do not use realpath() on includes.
authorAndreas Fischer <bantu@owncloud.com>
Wed, 21 Aug 2013 08:52:22 +0000 (10:52 +0200)
committerAndreas Fischer <bantu@owncloud.com>
Wed, 21 Aug 2013 08:52:22 +0000 (10:52 +0200)
If the file does not exist, realpath() returns false and "include false;"
produces "Failed opening '' for inclusion" which is a useless error message.

'include' works just fine with symlinks, "./" and "../".

apps/files_encryption/lib/crypt.php
apps/files_encryption/tests/crypt.php
apps/files_encryption/tests/keymanager.php
apps/files_encryption/tests/share.php
apps/files_encryption/tests/stream.php
apps/files_encryption/tests/trashbin.php
apps/files_encryption/tests/util.php
apps/files_encryption/tests/webdav.php

index 3947b7d0c3b83c307726abc9e67ec802813e1fb1..47801252bbd3f79525cb657729e7d5b34ceac312 100755 (executable)
@@ -25,7 +25,7 @@
 \r
 namespace OCA\Encryption;\r
 \r
-require_once realpath(dirname(__FILE__) . '/../3rdparty/Crypt_Blowfish/Blowfish.php');\r
+require_once dirname(__FILE__) . '/../3rdparty/Crypt_Blowfish/Blowfish.php';\r
 \r
 /**\r
  * Class for common cryptography functionality\r
index 2330a45be841bbdafcc0484ee9e17eadd6435156..a4bb3054efeb09cfcaf78fe4c43b0143fa33e06e 100755 (executable)
@@ -7,16 +7,16 @@
  * See the COPYING-README file.
  */
 
-require_once realpath(dirname(__FILE__) . '/../3rdparty/Crypt_Blowfish/Blowfish.php');
-require_once realpath(dirname(__FILE__) . '/../../../lib/base.php');
-require_once realpath(dirname(__FILE__) . '/../lib/crypt.php');
-require_once realpath(dirname(__FILE__) . '/../lib/keymanager.php');
-require_once realpath(dirname(__FILE__) . '/../lib/proxy.php');
-require_once realpath(dirname(__FILE__) . '/../lib/stream.php');
-require_once realpath(dirname(__FILE__) . '/../lib/util.php');
-require_once realpath(dirname(__FILE__) . '/../lib/helper.php');
-require_once realpath(dirname(__FILE__) . '/../appinfo/app.php');
-require_once realpath(dirname(__FILE__) . '/util.php');
+require_once dirname(__FILE__) . '/../3rdparty/Crypt_Blowfish/Blowfish.php';
+require_once dirname(__FILE__) . '/../../../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/crypt.php';
+require_once dirname(__FILE__) . '/../lib/keymanager.php';
+require_once dirname(__FILE__) . '/../lib/proxy.php';
+require_once dirname(__FILE__) . '/../lib/stream.php';
+require_once dirname(__FILE__) . '/../lib/util.php';
+require_once dirname(__FILE__) . '/../lib/helper.php';
+require_once dirname(__FILE__) . '/../appinfo/app.php';
+require_once dirname(__FILE__) . '/util.php';
 
 use OCA\Encryption;
 
index 13f8c3197c7e3c957791cd2379f57690eeab4188..6e8b7f2ff0ab911fbe2f2a568686cfa5fde1b8a7 100644 (file)
@@ -6,15 +6,15 @@
  * See the COPYING-README file.
  */
 
-require_once realpath(dirname(__FILE__) . '/../../../lib/base.php');
-require_once realpath(dirname(__FILE__) . '/../lib/crypt.php');
-require_once realpath(dirname(__FILE__) . '/../lib/keymanager.php');
-require_once realpath(dirname(__FILE__) . '/../lib/proxy.php');
-require_once realpath(dirname(__FILE__) . '/../lib/stream.php');
-require_once realpath(dirname(__FILE__) . '/../lib/util.php');
-require_once realpath(dirname(__FILE__) . '/../lib/helper.php');
-require_once realpath(dirname(__FILE__) . '/../appinfo/app.php');
-require_once realpath(dirname(__FILE__) . '/util.php');
+require_once dirname(__FILE__) . '/../../../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/crypt.php';
+require_once dirname(__FILE__) . '/../lib/keymanager.php';
+require_once dirname(__FILE__) . '/../lib/proxy.php';
+require_once dirname(__FILE__) . '/../lib/stream.php';
+require_once dirname(__FILE__) . '/../lib/util.php';
+require_once dirname(__FILE__) . '/../lib/helper.php';
+require_once dirname(__FILE__) . '/../appinfo/app.php';
+require_once dirname(__FILE__) . '/util.php';
 
 use OCA\Encryption;
 
index 5f3d500509007b1fd2be7b400961d31fcd1fb99b..7f68ecd388a521f85fe177dca8e15728a4fc88ba 100755 (executable)
  *
  */
 
-require_once realpath(dirname(__FILE__) . '/../3rdparty/Crypt_Blowfish/Blowfish.php');
-require_once realpath(dirname(__FILE__) . '/../../../lib/base.php');
-require_once realpath(dirname(__FILE__) . '/../lib/crypt.php');
-require_once realpath(dirname(__FILE__) . '/../lib/keymanager.php');
-require_once realpath(dirname(__FILE__) . '/../lib/proxy.php');
-require_once realpath(dirname(__FILE__) . '/../lib/stream.php');
-require_once realpath(dirname(__FILE__) . '/../lib/util.php');
-require_once realpath(dirname(__FILE__) . '/../lib/helper.php');
-require_once realpath(dirname(__FILE__) . '/../appinfo/app.php');
-require_once realpath(dirname(__FILE__) . '/util.php');
+require_once dirname(__FILE__) . '/../3rdparty/Crypt_Blowfish/Blowfish.php';
+require_once dirname(__FILE__) . '/../../../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/crypt.php';
+require_once dirname(__FILE__) . '/../lib/keymanager.php';
+require_once dirname(__FILE__) . '/../lib/proxy.php';
+require_once dirname(__FILE__) . '/../lib/stream.php';
+require_once dirname(__FILE__) . '/../lib/util.php';
+require_once dirname(__FILE__) . '/../lib/helper.php';
+require_once dirname(__FILE__) . '/../appinfo/app.php';
+require_once dirname(__FILE__) . '/util.php';
 
 use OCA\Encryption;
 
index 50ac41e4536ff6129f1806fc348c33b3845a1e14..adc0d1959a00d7c78f5131124bb9eb6b5598c770 100644 (file)
  *
  */
 
-require_once realpath(dirname(__FILE__) . '/../../../lib/base.php');
-require_once realpath(dirname(__FILE__) . '/../lib/crypt.php');
-require_once realpath(dirname(__FILE__) . '/../lib/keymanager.php');
-require_once realpath(dirname(__FILE__) . '/../lib/proxy.php');
-require_once realpath(dirname(__FILE__) . '/../lib/stream.php');
-require_once realpath(dirname(__FILE__) . '/../lib/util.php');
-require_once realpath(dirname(__FILE__) . '/../appinfo/app.php');
-require_once realpath(dirname(__FILE__) . '/util.php');
+require_once dirname(__FILE__) . '/../../../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/crypt.php';
+require_once dirname(__FILE__) . '/../lib/keymanager.php';
+require_once dirname(__FILE__) . '/../lib/proxy.php';
+require_once dirname(__FILE__) . '/../lib/stream.php';
+require_once dirname(__FILE__) . '/../lib/util.php';
+require_once dirname(__FILE__) . '/../appinfo/app.php';
+require_once dirname(__FILE__) . '/util.php';
 
 use OCA\Encryption;
 
index ade968fbece43f931b02a65c29ef30280de59ea7..55ec94782eb302067ae50ab10c0bbe320ecc6933 100755 (executable)
  *
  */
 
-require_once realpath(dirname(__FILE__) . '/../../../lib/base.php');
-require_once realpath(dirname(__FILE__) . '/../lib/crypt.php');
-require_once realpath(dirname(__FILE__) . '/../lib/keymanager.php');
-require_once realpath(dirname(__FILE__) . '/../lib/proxy.php');
-require_once realpath(dirname(__FILE__) . '/../lib/stream.php');
-require_once realpath(dirname(__FILE__) . '/../lib/util.php');
-require_once realpath(dirname(__FILE__) . '/../appinfo/app.php');
-require_once realpath(dirname(__FILE__) . '/../../files_trashbin/appinfo/app.php');
-require_once realpath(dirname(__FILE__) . '/util.php');
+require_once dirname(__FILE__) . '/../../../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/crypt.php';
+require_once dirname(__FILE__) . '/../lib/keymanager.php';
+require_once dirname(__FILE__) . '/../lib/proxy.php';
+require_once dirname(__FILE__) . '/../lib/stream.php';
+require_once dirname(__FILE__) . '/../lib/util.php';
+require_once dirname(__FILE__) . '/../appinfo/app.php';
+require_once dirname(__FILE__) . '/../../files_trashbin/appinfo/app.php';
+require_once dirname(__FILE__) . '/util.php';
 
 use OCA\Encryption;
 
index 368b7b3dc3f2a02427fc07d42db7955104463ee4..7f80de593382f6e4b856702ded75c61abca5baeb 100755 (executable)
@@ -6,13 +6,13 @@
  * See the COPYING-README file.
  */
 
-require_once realpath(dirname(__FILE__) . '/../../../lib/base.php');
-require_once realpath(dirname(__FILE__) . '/../lib/crypt.php');
-require_once realpath(dirname(__FILE__) . '/../lib/keymanager.php');
-require_once realpath(dirname(__FILE__) . '/../lib/proxy.php');
-require_once realpath(dirname(__FILE__) . '/../lib/stream.php');
-require_once realpath(dirname(__FILE__) . '/../lib/util.php');
-require_once realpath(dirname(__FILE__) . '/../appinfo/app.php');
+require_once dirname(__FILE__) . '/../../../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/crypt.php';
+require_once dirname(__FILE__) . '/../lib/keymanager.php';
+require_once dirname(__FILE__) . '/../lib/proxy.php';
+require_once dirname(__FILE__) . '/../lib/stream.php';
+require_once dirname(__FILE__) . '/../lib/util.php';
+require_once dirname(__FILE__) . '/../appinfo/app.php';
 
 use OCA\Encryption;
 
index 1d406789f0c1ac0b1bc1aa9a4d5c8d9efbae4d5e..b72f68169519deef3ad638e6441e748bc0924b8b 100755 (executable)
  *
  */
 
-require_once realpath(dirname(__FILE__) . '/../../../lib/base.php');
-require_once realpath(dirname(__FILE__) . '/../lib/crypt.php');
-require_once realpath(dirname(__FILE__) . '/../lib/keymanager.php');
-require_once realpath(dirname(__FILE__) . '/../lib/proxy.php');
-require_once realpath(dirname(__FILE__) . '/../lib/stream.php');
-require_once realpath(dirname(__FILE__) . '/../lib/util.php');
-require_once realpath(dirname(__FILE__) . '/../appinfo/app.php');
-require_once realpath(dirname(__FILE__) . '/util.php');
+require_once dirname(__FILE__) . '/../../../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/crypt.php';
+require_once dirname(__FILE__) . '/../lib/keymanager.php';
+require_once dirname(__FILE__) . '/../lib/proxy.php';
+require_once dirname(__FILE__) . '/../lib/stream.php';
+require_once dirname(__FILE__) . '/../lib/util.php';
+require_once dirname(__FILE__) . '/../appinfo/app.php';
+require_once dirname(__FILE__) . '/util.php';
 
 use OCA\Encryption;