Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/VfsPublic

Commite0aaaa6

Browse files
committed
Add type casting for mismatches which break in PHP 8.1
These may happen if horde runs from a copy of conf.php.dist
1 parent2c24014 commite0aaaa6

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

‎lib/Horde/Vfs/Base.php‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function __construct($params = array())
7878
'vfs_quotalimit' => -1,
7979
'vfs_quotaroot' =>''
8080
));
81-
$this->setParams($params);
81+
$this->setParams((array)$params);
8282
}
8383

8484
/**
@@ -122,7 +122,7 @@ protected function _connect()
122122
*/
123123
publicfunctionsetParams($params =array())
124124
{
125-
$this->_params =array_merge($this->_params,$params);
125+
$this->_params =array_merge($this->_params,(array)$params);
126126
}
127127

128128
/**
@@ -613,7 +613,8 @@ protected function _filterMatch($filter, $filename)
613613
$filter =implode('|',$filter);
614614
}
615615

616-
if (!strlen($filter)) {
616+
// TODO: PHP 8.1 Disallow other inputs than strings and arrays
617+
if (!is_string($filter) || !strlen($filter)) {
617618
returnfalse;
618619
}
619620

‎lib/Horde/Vfs/File.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ public function changePermissions($path, $name, $permission)
430430
protectedfunction_listFolder($path,$filter =null,$dotfiles =true,
431431
$dironly =false)
432432
{
433+
$path =$path ??'';
433434
$files =array();
434435
$dir =$this->_getNativePath(strlen($path) ?$path :'');
435436

‎lib/Horde/Vfs/Sql.php‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ public function deleteFolder($path, $name, $recursive = false)
517517
protectedfunction_listFolder($path,$filter =null,$dotfiles =true,
518518
$dironly =false)
519519
{
520+
$path =$path ??'';
520521
if (!$this->isFolder(dirname($path),basename($path))) {
521522
thrownewHorde_Vfs_Exception(sprintf('"%s" is not a folder.',$path));
522523
}
@@ -803,7 +804,7 @@ protected function _updateBlob($table, $field, $data, $where, $alsoupdate)
803804
*/
804805
protectedfunction_convertPath($path)
805806
{
806-
returntrim($path,'/');
807+
returntrim($path ??'','/');
807808
}
808809

809810
/**

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp