aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-08-09 11:35:14 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-08-09 11:35:14 +0200
commitd24582503a9f4e3b511cf7093748326a396779d0 (patch)
tree8ddf54a1aa4ed371a91b5b95d3a225dbdc26c0bd
parentf4ab2ba1150452917168dc57b2221c8d7ad6ff01 (diff)
downloadnextcloud-server-d24582503a9f4e3b511cf7093748326a396779d0.tar.gz
nextcloud-server-d24582503a9f4e3b511cf7093748326a396779d0.zip
Fix require statements. Fix for oc-1460.
-rw-r--r--apps/contacts/ajax/contact/addproperty.php14
-rw-r--r--apps/contacts/ajax/contact/delete.php3
-rw-r--r--apps/contacts/ajax/contact/deleteproperty.php3
-rw-r--r--apps/contacts/ajax/contact/saveproperty.php4
4 files changed, 14 insertions, 10 deletions
diff --git a/apps/contacts/ajax/contact/addproperty.php b/apps/contacts/ajax/contact/addproperty.php
index 58b857547fb..ca28140edf1 100644
--- a/apps/contacts/ajax/contact/addproperty.php
+++ b/apps/contacts/ajax/contact/addproperty.php
@@ -25,7 +25,7 @@ OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('contacts');
OCP\JSON::callCheck();
-require_once 'loghandler.php';
+require_once __DIR__.'/../loghandler.php';
$id = isset($_POST['id'])?$_POST['id']:null;
$name = isset($_POST['name'])?$_POST['name']:null;
@@ -48,9 +48,9 @@ if(!$vcard) {
if(!is_array($value)) {
$value = trim($value);
- if(!$value
+ if(!$value
&& in_array(
- $name,
+ $name,
array('TEL', 'EMAIL', 'ORG', 'BDAY', 'URL', 'NICKNAME', 'NOTE'))
) {
bailOut($l10n->t('Cannot add empty property.'));
@@ -78,9 +78,9 @@ foreach($current as $item) {
}
if(is_array($value)) {
- // NOTE: Important, otherwise the compound value will
+ // NOTE: Important, otherwise the compound value will
// be set in the order the fields appear in the form!
- ksort($value);
+ ksort($value);
$value = array_map('strip_tags', $value);
} else {
$value = strip_tags($value);
@@ -123,10 +123,10 @@ switch($name) {
$line = count($vcard->children) - 1;
-// Apparently Sabre_VObject_Parameter doesn't do well with
+// Apparently Sabre_VObject_Parameter doesn't do well with
// multiple values or I don't know how to do it. Tanghus.
foreach ($parameters as $key=>$element) {
- if(is_array($element) && strtoupper($key) == 'TYPE') {
+ if(is_array($element) && strtoupper($key) == 'TYPE') {
// NOTE: Maybe this doesn't only apply for TYPE?
// And it probably shouldn't be done here anyways :-/
foreach($element as $e) {
diff --git a/apps/contacts/ajax/contact/delete.php b/apps/contacts/ajax/contact/delete.php
index 9777046fc82..def98b36705 100644
--- a/apps/contacts/ajax/contact/delete.php
+++ b/apps/contacts/ajax/contact/delete.php
@@ -23,7 +23,8 @@
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('contacts');
OCP\JSON::callCheck();
-require_once 'loghandler.php';
+
+require_once __DIR__.'/../loghandler.php';
$id = isset($_POST['id'])?$_POST['id']:null;
if(!$id) {
diff --git a/apps/contacts/ajax/contact/deleteproperty.php b/apps/contacts/ajax/contact/deleteproperty.php
index 205df8bc184..9c3f09f8610 100644
--- a/apps/contacts/ajax/contact/deleteproperty.php
+++ b/apps/contacts/ajax/contact/deleteproperty.php
@@ -24,7 +24,8 @@
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('contacts');
OCP\JSON::callCheck();
-require_once 'loghandler.php';
+
+require_once __DIR__.'/../loghandler.php';
$id = $_POST['id'];
$checksum = $_POST['checksum'];
diff --git a/apps/contacts/ajax/contact/saveproperty.php b/apps/contacts/ajax/contact/saveproperty.php
index ef4d1b26c5b..f9880c78834 100644
--- a/apps/contacts/ajax/contact/saveproperty.php
+++ b/apps/contacts/ajax/contact/saveproperty.php
@@ -19,7 +19,9 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
-require_once 'loghandler.php';
+
+require_once __DIR__.'/../loghandler.php';
+
// Check if we are a user
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('contacts');