Skip to content
Snippets Groups Projects

Issue #3216238 by Fernly, mpp: Use of removed function drupal_basename() in Drupal 9

1 file
+ 2
2
Compare changes
  • Side-by-side
  • Inline
@@ -255,7 +255,7 @@ abstract class HtmlTagImgProcess extends HtmlTagProcess {
}
// Construct the full file path to the source file.
$source_name = drupal_basename($source);
$source_name = \Drupal::service('file_system')->basename($source);
if (file_exists($source)) {
// Make sure that the target folder exists and is writable.
@@ -366,7 +366,7 @@ abstract class HtmlTagImgProcess extends HtmlTagProcess {
$client = \Drupal::httpClient();
$request = $client->get($source);
$data = $request->getBody()->getContents();
$file_name = drupal_basename($source);
$file_name = \Drupal::service('file_system')->basename($source);
$file = $this->createFile($data, $target_folder . '/' . $file_name, $replace);
}
catch (\Exception $e) {
Loading