summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-01-05 09:31:17 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-01-05 09:31:17 +0000
commitb57ac48281c44847de6f128c109c5d13bd46d1cc (patch)
treee30de50e289a9ae890d45ab4f34513ff39532d8b
parent6236ff5e9118e0d334e0a55713f5f434ca8e332d (diff)
downloadwordpress-mu-b57ac48281c44847de6f128c109c5d13bd46d1cc.tar.gz
wordpress-mu-b57ac48281c44847de6f128c109c5d13bd46d1cc.tar.xz
wordpress-mu-b57ac48281c44847de6f128c109c5d13bd46d1cc.zip
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@492 7be80a69-a1ef-0310-a953-fb0f7c49ff36
-rw-r--r--wp-inst/wp-admin/import/blogger.php2
-rw-r--r--wp-inst/wp-admin/import/livejournal.php9
-rw-r--r--wp-inst/wp-admin/inline-uploading.php21
-rw-r--r--wp-inst/wp-content/themes/default/functions.php14
-rw-r--r--wp-inst/wp-content/themes/default/images/header-img.php7
-rw-r--r--wp-inst/wp-includes/cache.php49
-rw-r--r--wp-inst/wp-includes/classes.php6
-rw-r--r--wp-inst/wp-includes/functions-compat.php65
-rw-r--r--wp-inst/wp-includes/functions-post.php4
-rw-r--r--wp-inst/wp-includes/functions.php3
10 files changed, 67 insertions, 113 deletions
diff --git a/wp-inst/wp-admin/import/blogger.php b/wp-inst/wp-admin/import/blogger.php
index 2ad66ea..541c4f4 100644
--- a/wp-inst/wp-admin/import/blogger.php
+++ b/wp-inst/wp-admin/import/blogger.php
@@ -587,7 +587,7 @@ class Blogger_Import {
if ( count($this->import['blogs']) > 1 )
echo '<li>'.__('In case you haven\'t done it already, you can import the posts from your other blogs:'). $this->show_blogs() . '</li>';
if ( $n = count($this->import['blogs'][$_GET['blog']]['newusers']) )
- echo '<li>'.sptintf(__('Go to <a href="%s" target="%s">Authors &amp; Users</a>, where you can modify the new user(s) or delete them. If you want to make all of the imported posts yours, you will be given that option when you delete the new authors.'), 'users.php', '_parent').'</li>';
+ echo '<li>'.sprintf(__('Go to <a href="%s" target="%s">Authors &amp; Users</a>, where you can modify the new user(s) or delete them. If you want to make all of the imported posts yours, you will be given that option when you delete the new authors.'), 'users.php', '_parent').'</li>';
echo '<li>'.__('For security, click the link below to reset this importer. That will clear your Blogger credentials and options from the database.').'</li>';
echo '</ul>';
}
diff --git a/wp-inst/wp-admin/import/livejournal.php b/wp-inst/wp-admin/import/livejournal.php
index bc6bb91..e8c48c4 100644
--- a/wp-inst/wp-admin/import/livejournal.php
+++ b/wp-inst/wp-admin/import/livejournal.php
@@ -67,8 +67,8 @@ class LJ_Import {
printf(__('Post <i>%s</i> already exists.'), stripslashes($post_title));
} else {
printf(__('Importing post <i>%s</i>...'), stripslashes($post_title));
- $post = compact('post_author', 'post_date', 'post_content', 'post_title', 'post_status');
- $post_id = wp_insert_post($post);
+ $postdata = compact('post_author', 'post_date', 'post_content', 'post_title', 'post_status');
+ $post_id = wp_insert_post($postdata);
if (!$post_id) {
_e("Couldn't get post ID");
echo '</li>';
@@ -113,9 +113,10 @@ class LJ_Import {
}
}
}
- if ( $num_comments )
+ if ( $num_comments ) {
+ echo ' ';
printf(__('(%s comments)'), $num_comments);
-
+ }
echo '</li>';
flush();
ob_flush();
diff --git a/wp-inst/wp-admin/inline-uploading.php b/wp-inst/wp-admin/inline-uploading.php
index e1857a0..e3ff445 100644
--- a/wp-inst/wp-admin/inline-uploading.php
+++ b/wp-inst/wp-admin/inline-uploading.php
@@ -235,14 +235,15 @@ srcb[{$ID}] = '{$image['guid']}';
$xpadding = (128 - $image['uwidth']) / 2;
$ypadding = (96 - $image['uheight']) / 2;
$style .= "#target{$ID} img { padding: {$ypadding}px {$xpadding}px; }\n";
- $script .= "aa[{$ID}] = '<a id=\"p{$ID}\" rel=\"attachment\" class=\"imagelink\" href=\"$href\" onclick=\"doPopup({$ID});return false;\" title=\"{$image['post_title']}\">';
-ab[{$ID}] = '<a class=\"imagelink\" href=\"{$image['guid']}\" onclick=\"doPopup({$ID});return false;\" title=\"{$image['post_title']}\">';
-imga[{$ID}] = '<img id=\"image{$ID}\" src=\"$src\" alt=\"{$image['post_title']}\" $height_width />';
-imgb[{$ID}] = '<img id=\"image{$ID}\" src=\"{$image['guid']}\" alt=\"{$image['post_title']}\" $height_width />';
+ $title = htmlentities($image['post_title'], ENT_QUOTES);
+ $script .= "aa[{$ID}] = '<a id=\"p{$ID}\" rel=\"attachment\" class=\"imagelink\" href=\"$href\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">';
+ab[{$ID}] = '<a class=\"imagelink\" href=\"{$image['guid']}\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">';
+imga[{$ID}] = '<img id=\"image{$ID}\" src=\"$src\" alt=\"{$title}\" $height_width />';
+imgb[{$ID}] = '<img id=\"image{$ID}\" src=\"{$image['guid']}\" alt=\"{$title}\" $height_width />';
";
$html .= "<div id='target{$ID}' class='attwrap left'>
<div id='div{$ID}' class='imagewrap' onclick=\"doPopup({$ID});\">
- <img id=\"image{$ID}\" src=\"$src\" alt=\"{$image['post_title']}\" $height_width />
+ <img id=\"image{$ID}\" src=\"$src\" alt=\"{$title}\" $height_width />
</div>
{$noscript}
</div>
@@ -254,19 +255,19 @@ imgb[{$ID}] = '<img id=\"image{$ID}\" src=\"{$image['guid']}\" alt=\"{$image['po
</div>
";
} else {
- $title = $attachment['post_title'];
+ $title = htmlentities($attachment['post_title'], ENT_QUOTES);
$filename = basename($attachment['guid']);
$icon = get_attachment_icon($ID);
$toggle_icon = "<a id=\"I{$ID}\" onclick=\"toggleOtherIcon({$ID});return false;\" href=\"javascript:void()\">$__using_title</a>";
- $script .= "aa[{$ID}] = '<a id=\"p{$ID}\" rel=\"attachment\" href=\"$href\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">{$attachment['post_title']}</a>';
-ab[{$ID}] = '<a id=\"p{$ID}\" href=\"{$filename}\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">{$attachment['post_title']}</a>';
-title[{$ID}] = '{$attachment['post_title']}';
+ $script .= "aa[{$ID}] = '<a id=\"p{$ID}\" rel=\"attachment\" href=\"$href\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">{$title}</a>';
+ab[{$ID}] = '<a id=\"p{$ID}\" href=\"{$filename}\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">{$title}</a>';
+title[{$ID}] = '{$title}';
filename[{$ID}] = '{$filename}';
icon[{$ID}] = '{$icon}';
";
$html .= "<div id='target{$ID}' class='attwrap left'>
<div id='div{$ID}' class='otherwrap usingtext' onmousedown=\"selectLink({$ID})\" onclick=\"doPopup({$ID});return false;\">
- <a id=\"p{$ID}\" href=\"{$attachment['guid']}\" onmousedown=\"selectLink({$ID});\" onclick=\"return false;\">{$attachment['post_title']}</a>
+ <a id=\"p{$ID}\" href=\"{$attachment['guid']}\" onmousedown=\"selectLink({$ID});\" onclick=\"return false;\">{$title}</a>
</div>
{$noscript}
</div>
diff --git a/wp-inst/wp-content/themes/default/functions.php b/wp-inst/wp-content/themes/default/functions.php
index 2af0b16..23482a2 100644
--- a/wp-inst/wp-content/themes/default/functions.php
+++ b/wp-inst/wp-content/themes/default/functions.php
@@ -25,16 +25,18 @@ function kubrick_header_image() {
}
function kubrick_upper_color() {
- if ( strstr( kubrick_header_image_url(), 'header-img.php?' ) )
- return substr( kubrick_header_image(), 21, 6 );
- else
+ if ( strstr( $url = kubrick_header_image_url(), 'header-img.php?' ) ) {
+ parse_str(substr($url, strpos($url, '?') + 1), $q);
+ return $q['upper'];
+ } else
return '69aee7';
}
function kubrick_lower_color() {
- if ( strstr( kubrick_header_image_url(), 'header-img.php?' ) )
- return substr( kubrick_header_image(), 34, 6 );
- else
+ if ( strstr( $url = kubrick_header_image_url(), 'header-img.php?' ) ) {
+ parse_str(substr($url, strpos($url, '?') + 1), $q);
+ return $q['lower'];
+ } else
return '4180b6';
}
diff --git a/wp-inst/wp-content/themes/default/images/header-img.php b/wp-inst/wp-content/themes/default/images/header-img.php
index afae590..65a9e87 100644
--- a/wp-inst/wp-content/themes/default/images/header-img.php
+++ b/wp-inst/wp-content/themes/default/images/header-img.php
@@ -8,11 +8,14 @@ if ( ! function_exists('imagecreatefromjpeg') )
// Assign and validate the color values
$default = false;
-$vars = array('upper'=>array(0=>'r1', 2=>'g1', 4=>'b1'), 'lower'=>array(0=>'r2', 2=>'g2', 4=>'b2'));
+$vars = array('upper'=>array('r1', 'g1', 'b1'), 'lower'=>array('r2', 'g2', 'b2'));
foreach ( $vars as $var => $subvars ) {
if ( isset($_GET[$var]) ) {
foreach ( $subvars as $index => $subvar ) {
- $$subvar = hexdec( substr($_GET[$var], $index, 2) );
+ $length = strlen($_GET[$var]) / 3;
+ $v = substr($_GET[$var], $index * $length, $length);
+ if ( $length == 1 ) $v = '' . $v . $v;
+ $$subvar = hexdec( $v );
if ( $$subvar < 0 || $$subvar > 255 )
$default = true;
}
diff --git a/wp-inst/wp-includes/cache.php b/wp-inst/wp-includes/cache.php
index af932a7..0ae4350 100644
--- a/wp-inst/wp-includes/cache.php
+++ b/wp-inst/wp-includes/cache.php
@@ -91,7 +91,7 @@ class WP_Object_Cache {
if ( !$this->cache_enabled )
return;
- $this->rm($this->cache_dir.'*');
+ $this->rm_cache_dir();
$this->cache = array ();
$this->dirty_objects = array ();
$this->non_existant_objects = array ();
@@ -214,25 +214,36 @@ class WP_Object_Cache {
return $this->cache_dir."$group_dir/";
}
- function rm($fileglob) {
- if (is_file($fileglob)) {
- return @ unlink($fileglob);
- } else
- if (is_dir($fileglob)) {
- $ok = WP_Object_Cache::rm("$fileglob/*");
- if (!$ok)
- return false;
- return @ rmdir($fileglob);
- } else {
- $matching = glob($fileglob);
- if ($matching === false)
- return true;
- $rcs = array_map(array ('WP_Object_Cache', 'rm'), $matching);
- if (in_array(false, $rcs)) {
- return false;
- }
+ function rm_cache_dir() {
+ $dir = $this->cache_dir;
+ $dir = rtrim($dir, DIRECTORY_SEPARATOR);
+ $top_dir = $dir;
+ $stack = array($dir);
+
+ while (count($stack)) {
+ # Get last directory on stack
+ $dir = end($stack);
+
+ $dh = @ opendir($dir);
+ if (!$dh)
+ return false;
+
+ while (($file = @ readdir($dh)) !== false) {
+ if ($file == '.' or $file == '..')
+ continue;
+
+ if (@ is_dir($dir . DIRECTORY_SEPARATOR . $file))
+ $stack[] = $dir . DIRECTORY_SEPARATOR . $file;
+ else if (@ is_file($dir . DIRECTORY_SEPARATOR . $file))
+ @ unlink($dir . DIRECTORY_SEPARATOR . $file);
}
- return true;
+
+ if (end($stack) == $dir) {
+ if ( $dir != $top_dir)
+ @ rmdir($dir);
+ array_pop($stack);
+ }
+ }
}
function replace($id, $data, $group = 'default', $expire = '') {
diff --git a/wp-inst/wp-includes/classes.php b/wp-inst/wp-includes/classes.php
index 54218d8..5628797 100644
--- a/wp-inst/wp-includes/classes.php
+++ b/wp-inst/wp-includes/classes.php
@@ -1168,7 +1168,7 @@ class WP_Rewrite {
}
}
- function generate_rewrite_rules($permalink_structure, $page = true, $feed = true, $forcomments = false, $walk_dirs = true) {
+ function generate_rewrite_rules($permalink_structure, $paged = true, $feed = true, $forcomments = false, $walk_dirs = true) {
$feedregex2 = '';
foreach ($this->feeds as $feed_name) {
$feedregex2 .= $feed_name . '|';
@@ -1236,7 +1236,7 @@ class WP_Rewrite {
$rewrite = array();
if ($feed)
$rewrite = array($feedmatch => $feedquery, $feedmatch2 => $feedquery2);
- if ($page)
+ if ($paged)
$rewrite = $rewrite + array($pagematch => $pagequery);
if ($num_toks) {
@@ -1398,7 +1398,7 @@ class WP_Rewrite {
} else {
$rules .= "RewriteCond %{REQUEST_FILENAME} !-f\n" .
"RewriteCond %{REQUEST_FILENAME} !-d\n" .
- "RewriteRule . {$home_root}{$this->index}\n";
+ "RewriteRule . {$home_root}{$this->index} [L]\n";
}
$rules .= "</IfModule>\n";
diff --git a/wp-inst/wp-includes/functions-compat.php b/wp-inst/wp-includes/functions-compat.php
index a8ff650..7f631e0 100644
--- a/wp-inst/wp-includes/functions-compat.php
+++ b/wp-inst/wp-includes/functions-compat.php
@@ -64,7 +64,7 @@ if (!defined('CASE_UPPER')) {
* @link http://php.net/function.array_change_key_case
* @author Stephan Schmidt <schst@php.net>
* @author Aidan Lister <aidan@php.net>
- * @version $Revision: 3280 $
+ * @version $Revision: 3400 $
* @since PHP 4.2.0
* @require PHP 4.0.0 (user_error)
*/
@@ -89,67 +89,4 @@ if (!function_exists('array_change_key_case')) {
}
}
-/* Added in PHP 4.3.0 */
-
-if( !function_exists('glob') ):
-function glob($pattern) {
- // get pathname (everything up until the last / or \)
- $path=$output=null;
-// if(PHP_OS=='WIN32')
-// $slash='\\';
-// else
-// $slash='/';
- $slash = '/';
- $lastpos=strrpos($pattern,$slash);
- if(!($lastpos===false)) {
- $path=substr($pattern,0,$lastpos); #negative length means take from the right
- $pattern=substr($pattern,$lastpos+1);
- } else {
- //no dir info, use current dir
- $path=getcwd();
- }
- $handle=@ opendir($path);
- if($handle===false)
- return false;
- while($dir=readdir($handle)) {
- if ( '.' == $dir || '..' == $dir )
- continue;
- if (pattern_match($pattern,$dir))
- $output[]=$path . '/' . $dir;
- }
- closedir($handle);
- if(is_array($output))
- return $output;
-
- return false;
-}
-
-function pattern_match($pattern,$string) {
- // basically prepare a regular expression
- $out=null;
- $chunks=explode(';',$pattern);
- foreach($chunks as $pattern) {
- $escape=array('$','^','.','{','}','(',')','[',']','|');
- while(strpos($pattern,'**')!==false)
- $pattern=str_replace('**','*',$pattern);
- foreach($escape as $probe)
- $pattern=str_replace($probe,"\\$probe",$pattern);
-
- $pattern=str_replace('?*','*',
- str_replace('*?','*',
- str_replace('*',".*",
- str_replace('?','.{1,1}',$pattern))));
- $out[]=$pattern;
- }
-
- if(count($out)==1)
- return(eregi("^$out[0]$",$string));
- else
- foreach($out as $tester)
- if(eregi("^$tester$",$string))
- return true;
- return false;
-}
-endif;
-
?>
diff --git a/wp-inst/wp-includes/functions-post.php b/wp-inst/wp-includes/functions-post.php
index 12b2d68..cadc2b7 100644
--- a/wp-inst/wp-includes/functions-post.php
+++ b/wp-inst/wp-includes/functions-post.php
@@ -488,10 +488,6 @@ function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array(
$old_categories = array_unique($old_categories);
}
-
- $oldies = printr($old_categories,1);
- $newbies = printr($post_categories,1);
-
// Delete any?
$delete_cats = array_diff($old_categories,$post_categories);
diff --git a/wp-inst/wp-includes/functions.php b/wp-inst/wp-includes/functions.php
index de64053..87e00ea 100644
--- a/wp-inst/wp-includes/functions.php
+++ b/wp-inst/wp-includes/functions.php
@@ -593,6 +593,9 @@ function &get_post(&$post, $output = OBJECT) {
}
}
+ if ( defined(WP_IMPORTING) )
+ unset($post_cache);
+
if ( $output == OBJECT ) {
return $_post;
} elseif ( $output == ARRAY_A ) {