summaryrefslogtreecommitdiffstats
path: root/wp-includes
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes')
-rw-r--r--wp-includes/category.php20
-rw-r--r--wp-includes/formatting.php9
-rw-r--r--wp-includes/functions.php10
3 files changed, 21 insertions, 18 deletions
diff --git a/wp-includes/category.php b/wp-includes/category.php
index fb0ec87..8c73e6c 100644
--- a/wp-includes/category.php
+++ b/wp-includes/category.php
@@ -28,8 +28,8 @@ function &get_categories($args = '') {
$where = 'cat_ID > 0';
$inclusions = '';
if ( !empty($include) ) {
- $child_of = 0; //ignore child_of and exclude params if using include
- $exclude = '';
+ $child_of = 0; //ignore child_of and exclude params if using include
+ $exclude = '';
$incategories = preg_split('/[\s,]+/',$include);
if ( count($incategories) ) {
foreach ( $incategories as $incat ) {
@@ -40,8 +40,8 @@ function &get_categories($args = '') {
}
}
}
- if (!empty($inclusions))
- $inclusions .= ')';
+ if (!empty($inclusions))
+ $inclusions .= ')';
$where .= $inclusions;
$exclusions = '';
@@ -57,9 +57,9 @@ function &get_categories($args = '') {
}
}
}
- if (!empty($exclusions))
+ if (!empty($exclusions))
$exclusions .= ')';
- $exclusions = apply_filters('list_cats_exclusions', $exclusions );
+ $exclusions = apply_filters('list_cats_exclusions', $exclusions, $r );
$where .= $exclusions;
$having = '';
@@ -85,7 +85,7 @@ function &get_categories($args = '') {
function stamp_cat($cat) {
global $cat_stamps;
$cat->last_update_timestamp = $cat_stamps[$cat->cat_ID];
- return $cat;
+ return $cat;
}
$categories = array_map('stamp_cat', $categories);
unset($cat_stamps);
@@ -94,7 +94,7 @@ function &get_categories($args = '') {
if ( $child_of || $hierarchical )
$categories = & _get_cat_children($child_of, $categories);
- return apply_filters('get_categories', $categories);
+ return apply_filters('get_categories', $categories, $r);
}
// Retrieves category data given a category ID or category object.
@@ -115,6 +115,8 @@ function &get_category(&$category, $output = OBJECT) {
}
}
+ $_category = apply_filters('get_category', $_category);
+
if ( $output == OBJECT ) {
return $_category;
} elseif ( $output == ARRAY_A ) {
@@ -139,7 +141,7 @@ function get_category_by_path($category_path, $full_match = true, $output = OBJE
$categories = $wpdb->get_results("SELECT cat_ID, category_nicename, category_parent FROM $wpdb->categories WHERE category_nicename = '$leaf_path'");
- if ( empty($categories) )
+ if ( empty($categories) )
return NULL;
foreach ($categories as $category) {
diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index cc5e76b..7735d58 100644
--- a/wp-includes/formatting.php
+++ b/wp-includes/formatting.php
@@ -582,10 +582,11 @@ function antispambot($emailaddy, $mailto=0) {
}
function make_clickable($ret) {
- $ret = ' ' . $ret . ' ';
- $ret = preg_replace("#([\s>])(https?)://([^\s<>{}()]+[^\s.,<>{}()])#i", "$1<a href='$2://$3' rel='nofollow'>$2://$3</a>", $ret);
- $ret = preg_replace("#(\s)www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^ <>{}()\n\r]*[^., <>{}()\n\r]?)?)#i", "$1<a href='http://www.$2.$3$4' rel='nofollow'>www.$2.$3$4</a>", $ret);
- $ret = preg_replace("#(\s)([a-z0-9\-_.]+)@([a-z0-9\-_.]+)\.([^,< \n\r]+)#i", "$1<a href=\"mailto:$2@$3.$4\">$2@$3.$4</a>", $ret);
+ $ret = ' ' . $ret;
+ $ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "$1<a href='$2' rel='nofollow'>$2</a>", $ret);
+ $ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "$1<a href='http://$2' rel='nofollow'>$2</a>", $ret);
+ $ret = preg_replace("#(\s)([a-z0-9\-_.]+)@([^,< \n\r]+)#i", "$1<a href=\"mailto:$2@$3\">$2@$3</a>", $ret);
+ $ret = substr($ret, 1);
$ret = trim($ret);
return $ret;
}
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index e7c0302..cf981ec 100644
--- a/wp-includes/functions.php
+++ b/wp-includes/functions.php
@@ -1127,7 +1127,6 @@ function wp_nonce_ays($action) {
$adminurl = wp_get_referer();
$title = __('WordPress Confirmation');
- require_once(ABSPATH . '/wp-admin/admin-header.php');
// Remove extra layer of slashes.
$_POST = stripslashes_deep($_POST );
if ( $_POST ) {
@@ -1145,18 +1144,19 @@ function wp_nonce_ays($action) {
$html .= "\t<div id='message' class='confirm fade'>\n\t<p>" . wp_explain_nonce($action) . "</p>\n\t<p><a href='$adminurl'>" . __('No') . "</a> <a href='" . add_query_arg( '_wpnonce', wp_create_nonce($action), $_SERVER['REQUEST_URI'] ) . "'>" . __('Yes') . "</a></p>\n\t</div>\n";
}
$html .= "</body>\n</html>";
- echo $html;
- include_once(ABSPATH . '/wp-admin/admin-footer.php');
+ wp_die($html, $title);
}
-function wp_die($message) {
+function wp_die($message, $title = '') {
header('Content-Type: text/html; charset=utf-8');
+ if ( empty($title) )
+ $title = __('WordPress &rsaquo; Error');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>WordPress &rsaquo; <?php _e('Error'); ?></title>
+ <title><?php echo $title ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style media="screen" type="text/css">
<!--