Skip to content

Commit

Permalink
Simplify getting basename for path
Browse files Browse the repository at this point in the history
This API no longer exists in the Hack Standard Library, and it's also not massively necessary.
  • Loading branch information
muglug authored Nov 17, 2021
1 parent a70536c commit 46ccd8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/AttrTransform/ImgRequired.hack
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class HTMLPurifier_AttrTransform_ImgRequired extends HTMLPurifier\HTMLPurifier_A
if ($src) {
$alt = $config->def->defaults['Attr.DefaultImageAlt'];
if ($alt === '') {
$src_path = new File\Path((string)$attr['src']);
$attr['alt'] = $src_path->getBaseName();
$src_path = (string)$attr['src'];
$attr['alt'] = \basename($src_path);
} else {
$attr['alt'] = $alt;
}
Expand Down

0 comments on commit 46ccd8d

Please sign in to comment.