Make WordPress Core

Opened 17 years ago

Closed 16 years ago

#4435 closed enhancement (invalid)

Better display for non-image attachments with long filenames

Reported by: apokalyptik's profile apokalyptik Owned by:
Milestone: Priority: high
Severity: normal Version: 2.2
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

Index: wp-admin/upload-functions.php
===================================================================
--- wp-admin/upload-functions.php       (revision 5682)
+++ wp-admin/upload-functions.php       (working copy)
@@ -26,6 +26,14 @@
                $image_rel = wp_make_link_relative($image_src);
                $innerHTML = ' ' . str_replace($image_src, $image_rel, $innerHTML);
                $class = 'image';
+       } elseif ( strlen($innerHTML) > 15 ) {
+               $dot_position = strrpos($innerHTML, '.') + 1;
+               $addendum = '';
+               if ( $dot_position > 1 ) {
+                       $extension = strtoupper(substr($innerHTML, $dot_position));
+                       $addendum = '<br /><br />('.$extension.')';
+               }
+               $innerHTML = substr($innerHTML, 0, 11).'...'.$addendum;
        }
 
        $src_base = wp_get_attachment_url();
@@ -356,4 +364,4 @@
        }
 }
 
-?>
\ No newline at end of file
+?>

Attachments (1)

4435-vs-2.2.diff (759 bytes) - added by apokalyptik 17 years ago.

Download all attachments as: .zip

Change History (5)

#1 @foolswisdom
17 years ago

  • Keywords has-patch added
  • Milestone set to 2.3 (trunk)

#2 @ryan
17 years ago

  • Milestone changed from 2.3 to 2.4
  • Priority changed from normal to high

#3 @hangy
16 years ago

  • Summary changed from Better dispaly for non-image attachements with long filenames to Better display for non-image attachments with long filenames

#4 @westi
16 years ago

  • Milestone 2.5 deleted
  • Resolution set to invalid
  • Status changed from new to closed

Closing as INVALID.

The patch does still apply but the code in wp-admin/includes/upload.php is not used anywhere in the new admin pages.

Note: See TracTickets for help on using tickets.