if (\OC_DB::isError($result)) {
\OC_Log::write('Encryption library', \OC_DB::getErrorMessage($result), \OC_Log::ERROR);
- }
-
- while ( $row = $result->fetchRow() ) {
-
- $recoveryEnabled[] = $row['recovery_enabled'];
-
+ } else {
+ $row = $result->fetchRow();
+ if( isset( $row['recovery_enabled'] ) ) {
+ $recoveryEnabled[] = $row['recovery_enabled'];
+ }
}
// If no record is found
$result = $query->execute( array( $fileId ) );
+ $path = false;
if (\OC_DB::isError($result)) {
\OC_Log::write('Encryption library', \OC_DB::getErrorMessage($result), \OC_Log::ERROR);
+ } else {
+ $row = $result->fetchRow();
+ $path = substr( $row['path'], strlen('files') );
}
- $row = $result->fetchRow();
-
- return substr( $row['path'], 5 );
+ return $path;
}
if (\OC_DB::isError($result)) {
\OC_Log::write('Encryption library', \OC_DB::getErrorMessage($result), \OC_Log::ERROR);
- }
-
- $row = $result->fetchRow();
- if($row) {
- $migrationStatus[] = $row['migration_status'];
+ } else {
+ $row = $result->fetchRow();
+ if( isset( $row['migration_status'] ) ) {
+ $migrationStatus[] = $row['migration_status'];
+ }
}
// If no record is found
$result = $query->execute( array( $id ) );
+ $row = array();
if (\OC_DB::isError($result)) {
\OC_Log::write('Encryption library', \OC_DB::getErrorMessage($result), \OC_Log::ERROR);
+ } else {
+ $row = $result->fetchRow();
}
- $row = $result->fetchRow();
-
return $row;
}
$result = $query->execute( array( $id ) );
+ $row = array();
if (\OC_DB::isError($result)) {
\OC_Log::write('Encryption library', \OC_DB::getErrorMessage($result), \OC_Log::ERROR);
+ } else {
+ $row = $result->fetchRow();
}
- $row = $result->fetchRow();
-
return $row;
}
$result = $query->execute( array( $id ) );
+ $source = array();
if (\OC_DB::isError($result)) {
\OC_Log::write('Encryption library', \OC_DB::getErrorMessage($result), \OC_Log::ERROR);
+ } else {
+ $source = $result->fetchRow();
}
- $source = $result->fetchRow();
-
$fileOwner = false;
if ( isset( $source['parent'] ) ) {
$result = $query->execute( array( $parent ) );
+ $item = array();
if (\OC_DB::isError($result)) {
\OC_Log::write('Encryption library', \OC_DB::getErrorMessage($result), \OC_Log::ERROR);
+ } else {
+ $item = $result->fetchRow();
}
- $item = $result->fetchRow();
-
if ( isset( $item['parent'] ) ) {
$parent = $item['parent'];