Skip to content

Commit b8267b0

Browse files
committed
fix: patcher for phpseclib
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent bbd97ec commit b8267b0

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

scoper.inc.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,16 @@ static function (string $filePath, string $prefix, string $content): string {
7070
default => $content,
7171
};
7272
},
73+
// patchers for phpseclib
74+
static function (string $filePath, string $prefix, string $content): string {
75+
if (!str_contains($filePath, 'phpseclib/phpseclib') || !str_ends_with($filePath, '.php')) {
76+
return $content;
77+
}
78+
// Use modified prefix just for this patch.
79+
$s_prefix = str_replace( '\\', '\\\\', $prefix );
80+
$content = str_replace( "'phpseclib3\\\\", "'\\\\" . $s_prefix . '\\\\phpseclib3\\\\', $content );
81+
$content = str_replace( "'\\\\phpseclib3", "'\\\\" . $s_prefix . '\\\\phpseclib3', $content );
82+
return $content;
83+
}
7384
],
7485
];

0 commit comments

Comments
 (0)