mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge branch '4.12' into 4
This commit is contained in:
commit
8b148bf293
@ -301,14 +301,14 @@ class ClassInfo
|
||||
*/
|
||||
public static function classes_for_file($filePath)
|
||||
{
|
||||
$absFilePath = Director::getAbsFile($filePath);
|
||||
$absFilePath = Convert::slashes(Director::getAbsFile($filePath));
|
||||
$classManifest = ClassLoader::inst()->getManifest();
|
||||
$classes = $classManifest->getClasses();
|
||||
$classNames = $classManifest->getClassNames();
|
||||
|
||||
$matchedClasses = [];
|
||||
foreach ($classes as $lowerClass => $compareFilePath) {
|
||||
if (strcasecmp($absFilePath ?? '', $compareFilePath ?? '') === 0) {
|
||||
if (strcasecmp($absFilePath, Convert::slashes($compareFilePath ?? '')) === 0) {
|
||||
$matchedClasses[$lowerClass] = $classNames[$lowerClass];
|
||||
}
|
||||
}
|
||||
@ -324,14 +324,14 @@ class ClassInfo
|
||||
*/
|
||||
public static function classes_for_folder($folderPath)
|
||||
{
|
||||
$absFolderPath = Director::getAbsFile($folderPath);
|
||||
$absFolderPath = Convert::slashes(Director::getAbsFile($folderPath));
|
||||
$classManifest = ClassLoader::inst()->getManifest();
|
||||
$classes = $classManifest->getClasses();
|
||||
$classNames = $classManifest->getClassNames();
|
||||
|
||||
$matchedClasses = [];
|
||||
foreach ($classes as $lowerClass => $compareFilePath) {
|
||||
if (stripos($compareFilePath ?? '', $absFolderPath ?? '') === 0) {
|
||||
if (stripos(Convert::slashes($compareFilePath ?? ''), $absFolderPath) === 0) {
|
||||
$matchedClasses[$lowerClass] = $classNames[$lowerClass];
|
||||
}
|
||||
}
|
||||
|
@ -394,14 +394,7 @@ class StandardRelatedDataService implements RelatedDataService
|
||||
*/
|
||||
private function prepareClassNameLiteral(string $value): string
|
||||
{
|
||||
$c = chr(92);
|
||||
$escaped = str_replace($c ?? '', "{$c}{$c}", $value ?? '');
|
||||
// postgres
|
||||
if (stripos(get_class(DB::get_conn()), 'postgres') !== false) {
|
||||
return "E'{$escaped}'";
|
||||
}
|
||||
// mysql
|
||||
return "'{$escaped}'";
|
||||
return DB::get_conn()->quoteString($value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user