Ticket #2801: get_attachment_link-trim-fix.diff

File get_attachment_link-trim-fix.diff, 555 bytes (added by Libertus, 6 years ago)

The patch

  • wp-includes/template-functions-links.php

     
    125125                $parent = get_post($object->post_parent); 
    126126                $parentlink = get_permalink($object->post_parent); 
    127127                if (! strstr($parentlink, '?') ) 
    128                         $link = trim($parentlink, '/') . '/' . $object->post_name . '/'; 
     128                        $link = rtrim($parentlink, '/') . '/' . $object->post_name . '/'; 
    129129        } 
    130130 
    131131        if (! $link ) {