Changes in trunk/wp-includes/functions.php [12171:12310]
- File:
-
- 1 edited
-
trunk/wp-includes/functions.php (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r12171 r12310 972 972 973 973 /** 974 * Strip HTML and put links at the bottom of stripped content.975 *976 * Searches for all of the links, strips them out of the content, and places977 * them at the bottom of the content with numbers.978 *979 * @since 0.71980 *981 * @param string $content Content to get links982 * @return string HTML stripped out of content with links at the bottom.983 */984 function make_url_footnote( $content ) {985 preg_match_all( '/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches );986 $links_summary = "\n";987 for ( $i=0; $i<count($matches[0]); $i++ ) {988 $link_match = $matches[0][$i];989 $link_number = '['.($i+1).']';990 $link_url = $matches[2][$i];991 $link_text = $matches[4][$i];992 $content = str_replace( $link_match, $link_text . ' ' . $link_number, $content );993 $link_url = ( ( strtolower( substr( $link_url, 0, 7 ) ) != 'http://' ) && ( strtolower( substr( $link_url, 0, 8 ) ) != 'https://' ) ) ? get_option( 'home' ) . $link_url : $link_url;994 $links_summary .= "\n" . $link_number . ' ' . $link_url;995 }996 $content = strip_tags( $content );997 $content .= $links_summary;998 return $content;999 }1000 1001 /**1002 974 * Retrieve post title from XMLRPC XML. 1003 975 * … … 2134 2106 // separate the filename into a name and extension 2135 2107 $info = pathinfo($filename); 2136 $ext = !empty($info['extension']) ? $info['extension'] : '';2137 $name = basename($filename, ".{$ext}");2108 $ext = !empty($info['extension']) ? '.' . $info['extension'] : ''; 2109 $name = basename($filename, $ext); 2138 2110 2139 2111 // edge case: if file is named '.ext', treat as an empty name 2140 if( $name === ".$ext")2112 if( $name === $ext ) 2141 2113 $name = ''; 2142 2114 … … 2147 2119 $number = ''; 2148 2120 2149 if ( !empty( $ext ) ) 2150 $ext = ".$ext"; 2121 // change '.ext' to lower case 2122 if ( $ext && strtolower($ext) != $ext ) { 2123 $ext2 = strtolower($ext); 2124 $filename2 = preg_replace( '|' . preg_quote($ext) . '$|', $ext2, $filename ); 2125 2126 // check for both lower and upper case extension or image sub-sizes may be overwritten 2127 while ( file_exists($dir . "/$filename") || file_exists($dir . "/$filename2") ) { 2128 $new_number = $number + 1; 2129 $filename = str_replace( "$number$ext", "$new_number$ext", $filename ); 2130 $filename2 = str_replace( "$number$ext2", "$new_number$ext2", $filename2 ); 2131 $number = $new_number; 2132 } 2133 return $filename2; 2134 } 2151 2135 2152 2136 while ( file_exists( $dir . "/$filename" ) ) { … … 2300 2284 'avi' => 'video/avi', 2301 2285 'divx' => 'video/divx', 2286 'flv' => 'video/x-flv', 2302 2287 'mov|qt' => 'video/quicktime', 2303 2288 'mpeg|mpg|mpe' => 'video/mpeg', … … 2455 2440 $title = __( 'WordPress Failure Notice' ); 2456 2441 $html = esc_html( wp_explain_nonce( $action ) ); 2457 if ( wp_get_referer() ) 2442 if ( 'log-out' == $action ) 2443 $html .= "</p><p>" . sprintf( __( "Do you really want to <a href='%s'>log out</a>?"), wp_logout_url() ); 2444 elseif ( wp_get_referer() ) 2458 2445 $html .= "</p><p><a href='" . esc_url( remove_query_arg( 'updated', wp_get_referer() ) ) . "'>" . __( 'Please try again.' ) . "</a>"; 2459 elseif ( 'log-out' == $action ) 2460 $html .= "</p><p>" . sprintf( __( "Do you really want to <a href='%s'>log out</a>?"), wp_logout_url() ); 2461 2462 wp_die( $html, $title); 2446 2447 wp_die( $html, $title, array('response' => 403) ); 2463 2448 } 2464 2449 … … 2538 2523 ?> 2539 2524 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2525 <!-- Ticket #11289, IE bug fix: always pad the error page with enough characters such that it is greater than 512 bytes, even after gzip compression abcdefghijklmnopqrstuvwxyz1234567890aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz11223344556677889900abacbcbdcdcededfefegfgfhghgihihjijikjkjlklkmlmlnmnmononpopoqpqprqrqsrsrtstsubcbcdcdedefefgfabcadefbghicjkldmnoepqrfstugvwxhyz1i234j567k890laabmbccnddeoeffpgghqhiirjjksklltmmnunoovppqwqrrxsstytuuzvvw0wxx1yyz2z113223434455666777889890091abc2def3ghi4jkl5mno6pqr7stu8vwx9yz11aab2bcc3dd4ee5ff6gg7hh8ii9j0jk1kl2lmm3nnoo4p5pq6qrr7ss8tt9uuvv0wwx1x2yyzz13aba4cbcb5dcdc6dedfef8egf9gfh0ghg1ihi2hji3jik4jkj5lkl6kml7mln8mnm9ono --> 2540 2526 <html xmlns="http://www.w3.org/1999/xhtml" <?php if ( function_exists( 'language_attributes' ) ) language_attributes(); ?>> 2541 2527 <head> … … 2552 2538 <?php echo $message; ?> 2553 2539 </body> 2554 <!-- Ticket #8942, IE bug fix: always pad the error page with enough characters such that it is greater than 512 bytes, even after gzip compression abcdefghijklmnopqrstuvwxyz1234567890aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz11223344556677889900abacbcbdcdcededfefegfgfhghgihihjijikjkjlklkmlmlnmnmononpopoqpqprqrqsrsrtstsubcbcdcdedefefgfabcadefbghicjkldmnoepqrfstugvwxhyz1i234j567k890laabmbccnddeoeffpgghqhiirjjksklltmmnunoovppqwqrrxsstytuuzvvw0wxx1yyz2z113223434455666777889890091abc2def3ghi4jkl5mno6pqr7stu8vwx9yz11aab2bcc3dd4ee5ff6gg7hh8ii9j0jk1kl2lmm3nnoo4p5pq6qrr7ss8tt9uuvv0wwx1x2yyzz13aba4cbcb5dcdc6dedfef8egf9gfh0ghg1ihi2hji3jik4jkj5lkl6kml7mln8mnm9ono -->2555 2540 </html> 2556 2541 <?php … … 2956 2941 * function. 2957 2942 * 2958 * The current behavior is to trigger an user error if WP_DEBUG is defined and 2959 * is true. 2943 * The current behavior is to trigger an user error if WP_DEBUG is true. 2960 2944 * 2961 2945 * This function is to be used in every function in depreceated.php … … 2978 2962 2979 2963 // Allow plugin to filter the output error trigger 2980 if( defined('WP_DEBUG') && ( true === WP_DEBUG )&& apply_filters( 'deprecated_function_trigger_error', true )) {2964 if( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true )) { 2981 2965 if( !is_null($replacement) ) 2982 2966 trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) ); … … 2993 2977 * file. 2994 2978 * 2995 * The current behavior is to trigger an user error if WP_DEBUG is defined and 2996 * is true. 2979 * The current behavior is to trigger an user error if WP_DEBUG is true. 2997 2980 * 2998 2981 * This function is to be used in every file that is depreceated … … 3015 2998 3016 2999 // Allow plugin to filter the output error trigger 3017 if( defined('WP_DEBUG') && ( true === WP_DEBUG ) && apply_filters( 'deprecated_file_trigger_error', true )) {3000 if( WP_DEBUG && apply_filters( 'deprecated_file_trigger_error', true ) ) { 3018 3001 if( !is_null($replacement) ) 3019 3002 trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $file, $version, $replacement ) ); … … 3086 3069 return 1; 3087 3070 3071 if (!empty ( $allowed_files ) && (!in_array( $file, $allowed_files ) ) ) 3072 return 3; 3073 3088 3074 if (':' == substr( $file, 1, 1 )) 3089 3075 return 2; 3090 3091 if (!empty ( $allowed_files ) && (!in_array( $file, $allowed_files ) ) )3092 return 3;3093 3076 3094 3077 return 0;
Note: See TracChangeset
for help on using the changeset viewer.