Skip to content

fix: ensure file names are string-typed - #61332

Merged
AndyScherzinger merged 1 commit into
masterfrom
fix/string-expected-int-given
Jun 17, 2026
Merged

fix: ensure file names are string-typed#61332
AndyScherzinger merged 1 commit into
masterfrom
fix/string-expected-int-given

Conversation

@blizzz

@blizzzblizzz commented Jun 16, 2026

Copy link
Copy Markdown
Member
  • $child was used as an array key earlier. If they are numeric, they are automatically converted to ints, leading to type issues later.

Summary

Fixes an Argument #1 ($haystack) must be of type string, int given on occ files:scan with remotely shared file/folder names that are numbers.

TypeError: str_starts_with(): Argument #1 ($haystack) must be of type string, int given in /var/www/nextcloud/lib/private/Files/Cache/Propagator.php:48
Stack trace:
#0 /var/www/nextcloud/lib/private/Files/Cache/Propagator.php(48): str_starts_with()
#1 /var/www/nextcloud/lib/private/Files/Utils/Scanner.php(290): OC\Files\Cache\Propagator->propagateChange()
#2 /var/www/nextcloud/lib/private/Files/Utils/Scanner.php(294): OC\Files\Utils\Scanner->triggerPropagator()
#3 /var/www/nextcloud/lib/private/Files/Utils/Scanner.php(238): OC\Files\Utils\Scanner->postProcessEntry()
#4 [internal function]: OC\Files\Utils\Scanner->OC\Files\Utils\{closure}()
#5 /var/www/nextcloud/lib/private/Hooks/EmitterTrait.php(89): call_user_func_array()
#6 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(253): OC\Hooks\BasicEmitter->emit()
#7 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(530): OC\Files\Cache\Scanner->removeFromCache()
#8 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(414): OC\Files\Cache\Scanner->handleChildren()
#9 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(323): OC\Files\Cache\Scanner->scanChildren()
#10 /var/www/nextcloud/apps/files_sharing/lib/External/Scanner.php(22): OC\Files\Cache\Scanner->scan()
#11 /var/www/nextcloud/lib/private/Files/Utils/Scanner.php(265): OCA\Files_Sharing\External\Scanner->scan()
#12 /var/www/nextcloud/apps/files/lib/Command/Scan.php(165): OC\Files\Utils\Scanner->scan()
#13 /var/www/nextcloud/apps/files/lib/Command/Scan.php(255): OCA\Files\Command\Scan->scanFiles()
#14 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(326): OCA\Files\Command\Scan->execute()
#15 /var/www/nextcloud/core/Command/Base.php(218): Symfony\Component\Console\Command\Command->run()
#16 /var/www/nextcloud/3rdparty/symfony/console/Application.php(1083): OC\Core\Command\Base->run()
#17 /var/www/nextcloud/3rdparty/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand()
#18 /var/www/nextcloud/3rdparty/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun()
#19 /var/www/nextcloud/lib/private/Console/Application.php(187): Symfony\Component\Console\Application->run()
#20 /var/www/nextcloud/console.php(90): OC\Console\Application->run()
#21 /var/www/nextcloud/occ(33): require_once('...')
#22 {main}

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

- `$child` was used as an array key earlier. If they are numeric, they
are automatically converted to ints, leading to type issues later.
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
@blizzzblizzz added this to the Nextcloud 35 milestone Jun 16, 2026
@blizzz
blizzz requested a review from a team as a code ownerJune 16, 2026 11:17
@blizzz
blizzz requested review from artonge, leftybournes, nfebe and salmart-dev and removed request for a teamJune 16, 2026 11:17
@blizzz

Copy link
Copy Markdown
MemberAuthor

/backport to stable34

@blizzz

Copy link
Copy Markdown
MemberAuthor

/backport to stable33

@blizzz

Copy link
Copy Markdown
MemberAuthor

/backport to stable32

@blizzz
blizzz requested review from a team and sorbaughJune 16, 2026 11:23
@AndyScherzinger
AndyScherzinger merged commit f985b90 into masterJun 17, 2026
255 of 272 checks passed
@AndyScherzinger
AndyScherzinger deleted the fix/string-expected-int-given branch June 17, 2026 05:25
@nextcloud-botnextcloud-bot mentioned this pull request Aug 11, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@blizzz@AndyScherzinger@SystemKeeper