Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 53051
Collapse All | Expand All

(-)wordpress/index.php (-10 / +11 lines)
Lines 1-4 Link Here
1
<?php 
1
<?php
2
/* Don't remove this line. */
2
/* Don't remove this line. */
3
require('./wp-blog-header.php');
3
require('./wp-blog-header.php');
4
?>
4
?>
Lines 7-25 Link Here
7
7
8
<head profile="http://gmpg.org/xfn/1">
8
<head profile="http://gmpg.org/xfn/1">
9
	<title><?php bloginfo('name'); ?><?php wp_title(); ?></title>
9
	<title><?php bloginfo('name'); ?><?php wp_title(); ?></title>
10
	
10
11
	<meta http-equiv="Content-Type" content="text/html; charset=<?php bloginfo('charset'); ?>" />
11
	<meta http-equiv="Content-Type" content="text/html; charset=<?php bloginfo('charset'); ?>" />
12
	<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats -->
12
	<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats -->
13
13
14
	<style type="text/css" media="screen">
14
	<style type="text/css" media="screen">
15
		@import url( <?php echo get_settings('siteurl'); ?>/wp-layout.css );
15
		@import url( <?php echo get_settings('siteurl'); ?>/wp-layout.css );
16
	</style>
16
	</style>
17
	
17
18
	<link rel="stylesheet" type="text/css" media="print" href="<?php echo get_settings('siteurl'); ?>/print.css" />
18
	<link rel="stylesheet" type="text/css" media="print" href="<?php echo get_settings('siteurl'); ?>/print.css" />
19
	<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
19
	<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
20
	<link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
20
	<link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
21
	<link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
21
	<link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
22
	
22
23
	<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
23
	<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
24
    <?php wp_get_archives('type=monthly&format=link'); ?>
24
    <?php wp_get_archives('type=monthly&format=link'); ?>
25
	<?php //comments_popup_script(); // off by default ?>
25
	<?php //comments_popup_script(); // off by default ?>
Lines 34-58 Link Here
34
<?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
34
<?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
35
35
36
<?php the_date('','<h2>','</h2>'); ?>
36
<?php the_date('','<h2>','</h2>'); ?>
37
	
37
38
<div class="post">
38
<div class="post">
39
	 <h3 class="storytitle" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h3>
39
	 <h3 class="storytitle" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h3>
40
	<div class="meta"><?php _e("Filed under:"); ?> <?php the_category() ?> &#8212; <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(); ?></div>
40
	<div class="meta"><?php _e("Filed under:"); ?> <?php the_category() ?> &#8212; <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(); ?></div>
41
	
41
42
	<div class="storycontent">
42
	<div class="storycontent">
43
		<?php the_content(); ?>
43
		<?php the_content(); ?>
44
	</div>
44
	</div>
45
	
45
46
	<div class="feedback">
46
	<div class="feedback">
47
            <?php wp_link_pages(); ?>
47
            <?php wp_link_pages(); ?>
48
            <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
48
            <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
49
	</div>
49
	</div>
50
	
50
51
	<!--
51
	<!--
52
	<?php trackback_rdf(); ?>
52
	<?php trackback_rdf(); ?>
53
	-->
53
	-->
54
54
55
<?php include(ABSPATH . 'wp-comments.php'); ?>
55
<?php include('./wp-comments.php'); ?>
56
</div>
56
</div>
57
57
58
<?php endforeach; else: ?>
58
<?php endforeach; else: ?>
Lines 72-78 Link Here
72
	</ul>
72
	</ul>
73
 </li>
73
 </li>
74
 <li id="search">
74
 <li id="search">
75
   <label for="s"><?php _e('Search:'); ?></label>	
75
   <label for="s"><?php _e('Search:'); ?></label>
76
   <form id="searchform" method="get" action="<?php echo $PHP_SELF; ?>">
76
   <form id="searchform" method="get" action="<?php echo $PHP_SELF; ?>">
77
	<div>
77
	<div>
78
		<input type="text" name="s" id="s" size="15" /><br />
78
		<input type="text" name="s" id="s" size="15" /><br />
Lines 112-114 Link Here
112
<p class="credit"><!--<?php echo $wpdb->num_queries; ?> queries. <?php timer_stop(1); ?> seconds. --> <cite><?php echo sprintf(__("Powered by <a href='http://wordpress.org' title='%s'><strong>WordPress</strong></a>"), __("Powered by WordPress, state-of-the-art semantic personal publishing platform")); ?></cite></p>
112
<p class="credit"><!--<?php echo $wpdb->num_queries; ?> queries. <?php timer_stop(1); ?> seconds. --> <cite><?php echo sprintf(__("Powered by <a href='http://wordpress.org' title='%s'><strong>WordPress</strong></a>"), __("Powered by WordPress, state-of-the-art semantic personal publishing platform")); ?></cite></p>
113
</body>
113
</body>
114
</html>
114
</html>
115
(-)wordpress/wp-admin/categories.php (-7 / +7 lines)
Lines 42-58 Link Here
42
42
43
    $standalone = 1;
43
    $standalone = 1;
44
    require_once('admin-header.php');
44
    require_once('admin-header.php');
45
    
45
46
    if ($user_level < 3)
46
    if ($user_level < 3)
47
        die (__('Cheatin&#8217; uh?'));
47
        die (__('Cheatin&#8217; uh?'));
48
    
48
49
    $cat_name= addslashes(stripslashes(stripslashes($_POST['cat_name'])));
49
    $cat_name= addslashes(stripslashes(stripslashes($_POST['cat_name'])));
50
    $category_nicename = sanitize_title($cat_name);
50
    $category_nicename = sanitize_title($cat_name);
51
    $category_description = addslashes(stripslashes(stripslashes($_POST['category_description'])));
51
    $category_description = addslashes(stripslashes(stripslashes($_POST['category_description'])));
52
    $cat = intval($_POST['cat']);
52
    $cat = intval($_POST['cat']);
53
53
54
    $wpdb->query("INSERT INTO $tablecategories (cat_ID, cat_name, category_nicename, category_description, category_parent) VALUES ('0', '$cat_name', '$category_nicename', '$category_description', '$cat')");
54
    $wpdb->query("INSERT INTO $tablecategories (cat_ID, cat_name, category_nicename, category_description, category_parent) VALUES ('0', '$cat_name', '$category_nicename', '$category_description', '$cat')");
55
    
55
56
    header('Location: categories.php?message=1#addcat');
56
    header('Location: categories.php?message=1#addcat');
57
57
58
break;
58
break;
Lines 123-136 Link Here
123
123
124
    if ($user_level < 3)
124
    if ($user_level < 3)
125
        die (__('Cheatin&#8217; uh?'));
125
        die (__('Cheatin&#8217; uh?'));
126
    
126
127
    $cat_name = $wpdb->escape(stripslashes($_POST['cat_name']));
127
    $cat_name = $wpdb->escape(stripslashes($_POST['cat_name']));
128
    $cat_ID = (int) $_POST['cat_ID'];
128
    $cat_ID = (int) $_POST['cat_ID'];
129
    $category_nicename = sanitize_title($cat_name);
129
    $category_nicename = sanitize_title($cat_name);
130
    $category_description = $wpdb->escape(stripslashes($_POST['category_description']));
130
    $category_description = $wpdb->escape(stripslashes($_POST['category_description']));
131
131
132
    $wpdb->query("UPDATE $tablecategories SET cat_name = '$cat_name', category_nicename = '$category_nicename', category_description = '$category_description', category_parent = '$cat' WHERE cat_ID = '$cat_ID'");
132
    $wpdb->query("UPDATE $tablecategories SET cat_name = '$cat_name', category_nicename = '$category_nicename', category_description = '$category_description', category_parent = '$cat' WHERE cat_ID = '$cat_ID'");
133
    
133
134
    header('Location: categories.php?message=3');
134
    header('Location: categories.php?message=3');
135
135
136
break;
136
break;
Lines 177-189 Link Here
177
<div class="wrap">
177
<div class="wrap">
178
    <h2><?php _e('Add New Category') ?></h2>
178
    <h2><?php _e('Add New Category') ?></h2>
179
    <form name="addcat" id="addcat" action="categories.php" method="post">
179
    <form name="addcat" id="addcat" action="categories.php" method="post">
180
        
180
181
        <p><?php _e('Name:') ?><br />
181
        <p><?php _e('Name:') ?><br />
182
        <input type="text" name="cat_name" value="" /></p>
182
        <input type="text" name="cat_name" value="" /></p>
183
        <p><?php _e('Category parent:') ?><br />
183
        <p><?php _e('Category parent:') ?><br />
184
        <select name='cat' class='postform'>
184
        <select name='cat' class='postform'>
185
        <option value='0'><?php _e('None') ?></option>
185
        <option value='0'><?php _e('None') ?></option>
186
        <?php wp_dropdown_cats(); ?></p>
186
        <?php wp_dropdown_cats(false); ?></p>
187
        </select>
187
        </select>
188
        <p><?php _e('Description: (optional)') ?> <br />
188
        <p><?php _e('Description: (optional)') ?> <br />
189
        <textarea name="category_description" rows="5" cols="50" style="width: 97%;"></textarea></p>
189
        <textarea name="category_description" rows="5" cols="50" style="width: 97%;"></textarea></p>
(-)wordpress/wp-blog-header.php (-12 / +12 lines)
Lines 1-11 Link Here
1
<?php
1
<?php
2
2
3
if (!file_exists(dirname(__FILE__).'/' . 'wp-config.php'))
3
if (!file_exists('./wp-config.php'))
4
    die("There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started. Need more help? <a href='http://wordpress.org/docs/faq/#wp-config'>We got it</a>. You can <a href='wp-admin/setup-config.php'>create a <code>wp-config.php</code> file through a web interface</a>, but this doesn't work for all server setups. The safest way is to manually create the file.");
4
    die("There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started. Need more help? <a href='http://wordpress.org/docs/faq/#wp-config'>We got it</a>. You can <a href='wp-admin/setup-config.php'>create a <code>wp-config.php</code> file through a web interface</a>, but this doesn't work for all server setups. The safest way is to manually create the file.");
5
5
6
require_once(dirname(__FILE__).'/' . '/wp-config.php');
6
require_once('./wp-config.php');
7
7
8
require_once(dirname(__FILE__).'/' . 'wp-includes/wp-l10n.php');
8
require_once('wp-includes/wp-l10n.php');
9
9
10
// Process PATH_INFO, if set.
10
// Process PATH_INFO, if set.
11
$path_info = array();
11
$path_info = array();
Lines 46-52 Link Here
46
                parse_str($query, $path_info);
46
                parse_str($query, $path_info);
47
            }
47
            }
48
        }
48
        }
49
    }    
49
    }
50
}
50
}
51
51
52
$wpvarstoreset = array('m','p','posts','w', 'cat','withcomments','s','search','exact', 'sentence','poststart','postend','preview','debug', 'calendar','page','paged','more','tb', 'pb','author','order','orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'feed', 'author_name');
52
$wpvarstoreset = array('m','p','posts','w', 'cat','withcomments','s','search','exact', 'sentence','poststart','postend','preview','debug', 'calendar','page','paged','more','tb', 'pb','author','order','orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'feed', 'author_name');
Lines 236-242 Link Here
236
    $cache_categories[$catt->cat_ID] = $catt;
236
    $cache_categories[$catt->cat_ID] = $catt;
237
}
237
}
238
238
239
if ((empty($cat)) || ($cat == 'all') || ($cat == '0') || 
239
if ((empty($cat)) || ($cat == 'all') || ($cat == '0') ||
240
	// Bypass cat checks if fetching specific posts
240
	// Bypass cat checks if fetching specific posts
241
	(
241
	(
242
		intval($year) || intval($monthnum) || intval($day) || intval($w) ||
242
		intval($year) || intval($monthnum) || intval($day) || intval($w) ||
Lines 474-480 Link Here
474
        ID, category_id, cat_name, category_nicename, category_description, category_parent
474
        ID, category_id, cat_name, category_nicename, category_description, category_parent
475
        FROM $tablecategories, $tablepost2cat, $tableposts
475
        FROM $tablecategories, $tablepost2cat, $tableposts
476
        WHERE category_id = cat_ID AND post_id = ID AND post_id IN ($post_id_list)");
476
        WHERE category_id = cat_ID AND post_id = ID AND post_id IN ($post_id_list)");
477
        
477
478
    foreach ($dogs as $catt) {
478
    foreach ($dogs as $catt) {
479
        $category_cache[$catt->ID][] = $catt;
479
        $category_cache[$catt->ID][] = $catt;
480
    }
480
    }
Lines 485-491 Link Here
485
        LEFT JOIN $tablecomments ON ( comment_post_ID = ID  AND comment_approved =  '1')
485
        LEFT JOIN $tablecomments ON ( comment_post_ID = ID  AND comment_approved =  '1')
486
        WHERE post_status =  'publish' AND ID IN ($post_id_list)
486
        WHERE post_status =  'publish' AND ID IN ($post_id_list)
487
        GROUP BY ID");
487
        GROUP BY ID");
488
    
488
489
	if ($comment_counts) {
489
	if ($comment_counts) {
490
	    foreach ($comment_counts as $comment_count) {
490
	    foreach ($comment_counts as $comment_count) {
491
	        $comment_count_cache["$comment_count->ID"] = $comment_count->ccount;
491
	        $comment_count_cache["$comment_count->ID"] = $comment_count->ccount;
Lines 494-518 Link Here
494
494
495
	// Get post-meta info
495
	// Get post-meta info
496
	if ( $meta_list = $wpdb->get_results("
496
	if ( $meta_list = $wpdb->get_results("
497
			SELECT post_id,meta_key,meta_value 
497
			SELECT post_id,meta_key,meta_value
498
			FROM $tablepostmeta 
498
			FROM $tablepostmeta
499
			WHERE post_id IN($post_id_list)
499
			WHERE post_id IN($post_id_list)
500
			ORDER BY post_id,meta_key
500
			ORDER BY post_id,meta_key
501
		", ARRAY_A) ) {
501
		", ARRAY_A) ) {
502
		
502
503
		// Change from flat structure to hierarchical:
503
		// Change from flat structure to hierarchical:
504
		$post_meta_cache = array();
504
		$post_meta_cache = array();
505
		foreach ($meta_list as $metarow) {
505
		foreach ($meta_list as $metarow) {
506
			$mpid = $metarow['post_id'];
506
			$mpid = $metarow['post_id'];
507
			$mkey = $metarow['meta_key'];
507
			$mkey = $metarow['meta_key'];
508
			$mval = $metarow['meta_value'];
508
			$mval = $metarow['meta_value'];
509
			
509
510
			// Force subkeys to be array type:
510
			// Force subkeys to be array type:
511
			if (!isset($post_meta_cache[$mpid]) || !is_array($post_meta_cache[$mpid]))
511
			if (!isset($post_meta_cache[$mpid]) || !is_array($post_meta_cache[$mpid]))
512
				$post_meta_cache[$mpid] = array();
512
				$post_meta_cache[$mpid] = array();
513
			if (!isset($post_meta_cache[$mpid]["$mkey"]) || !is_array($post_meta_cache[$mpid]["$mkey"]))
513
			if (!isset($post_meta_cache[$mpid]["$mkey"]) || !is_array($post_meta_cache[$mpid]["$mkey"]))
514
				$post_meta_cache[$mpid]["$mkey"] = array();
514
				$post_meta_cache[$mpid]["$mkey"] = array();
515
			
515
516
			// Add a value to the current pid/key:
516
			// Add a value to the current pid/key:
517
			$post_meta_cache[$mpid][$mkey][] = $mval;
517
			$post_meta_cache[$mpid][$mkey][] = $mval;
518
		}
518
		}
(-)wordpress/wp-comments-post.php (-6 / +6 lines)
Lines 1-5 Link Here
1
<?php
1
<?php
2
require( dirname(__FILE__) . '/wp-config.php' );
2
require( './wp-config.php' );
3
3
4
function add_magic_quotes($array) {
4
function add_magic_quotes($array) {
5
	foreach ($array as $k => $v) {
5
	foreach ($array as $k => $v) {
Lines 10-16 Link Here
10
		}
10
		}
11
	}
11
	}
12
	return $array;
12
	return $array;
13
} 
13
}
14
14
15
if (!get_magic_quotes_gpc()) {
15
if (!get_magic_quotes_gpc()) {
16
	$_POST   = add_magic_quotes($_POST);
16
	$_POST   = add_magic_quotes($_POST);
Lines 68-76 Link Here
68
	$approved = 0;
68
	$approved = 0;
69
}
69
}
70
70
71
$wpdb->query("INSERT INTO $tablecomments 
71
$wpdb->query("INSERT INTO $tablecomments
72
(comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content, comment_approved) 
72
(comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content, comment_approved)
73
VALUES 
73
VALUES
74
('$comment_post_ID', '$author', '$email', '$url', '$user_ip', '$now', '$now_gmt', '$comment', '$approved')
74
('$comment_post_ID', '$author', '$email', '$url', '$user_ip', '$now', '$now_gmt', '$comment', '$approved')
75
");
75
");
76
76
Lines 101-104 Link Here
101
	header("Location: $location");
101
	header("Location: $location");
102
}
102
}
103
103
104
?>
104
?>
(-)wordpress/wp-content/plugins/markdown.php (-29 / +29 lines)
Lines 6-12 Link Here
6
Version: 1.0b4
6
Version: 1.0b4
7
Author: John Gruber
7
Author: John Gruber
8
Author URI: http://daringfireball.net/
8
Author URI: http://daringfireball.net/
9
*/ 
9
*/
10
10
11
11
12
/*
12
/*
Lines 18-24 Link Here
18
$g_empty_element_suffix = " />";     # Change to ">" for HTML output
18
$g_empty_element_suffix = " />";     # Change to ">" for HTML output
19
$g_tab_width = 4;
19
$g_tab_width = 4;
20
$g_nested_brackets_depth = 6;
20
$g_nested_brackets_depth = 6;
21
$g_nested_brackets = 
21
$g_nested_brackets =
22
	str_repeat('(?>[^\[\]]+|\[', $g_nested_brackets_depth).
22
	str_repeat('(?>[^\[\]]+|\[', $g_nested_brackets_depth).
23
	str_repeat('\])*', $g_nested_brackets_depth);
23
	str_repeat('\])*', $g_nested_brackets_depth);
24
$g_escape_table = array(
24
$g_escape_table = array(
Lines 133-139 Link Here
133
					[ \t]*
133
					[ \t]*
134
					<(hr)				# start tag = $2
134
					<(hr)				# start tag = $2
135
					\b					# word break
135
					\b					# word break
136
					([^<>])*?			# 
136
					([^<>])*?			#
137
					/?>					# the matching end tag
137
					/?>					# the matching end tag
138
					(?=\n{2,}|\Z)		# followed by a blank line or end of document
138
					(?=\n{2,}|\Z)		# followed by a blank line or end of document
139
				)
139
				)
Lines 153-166 Link Here
153
153
154
function _RunBlockGamut($text) {
154
function _RunBlockGamut($text) {
155
	global $g_empty_element_suffix;
155
	global $g_empty_element_suffix;
156
	
156
157
	$text = _DoHeaders($text);
157
	$text = _DoHeaders($text);
158
158
159
	$text = preg_replace(
159
	$text = preg_replace(
160
		array('/^( ?\* ?){3,}$/m',
160
		array('/^( ?\* ?){3,}$/m',
161
			  '/^( ?- ?){3,}$/m'),
161
			  '/^( ?- ?){3,}$/m'),
162
		array("\n<hr$g_empty_element_suffix\n", 
162
		array("\n<hr$g_empty_element_suffix\n",
163
			  "\n<hr$g_empty_element_suffix\n"), 
163
			  "\n<hr$g_empty_element_suffix\n"),
164
		$text);
164
		$text);
165
165
166
	$text = _DoLists($text);
166
	$text = _DoLists($text);
Lines 191-197 Link Here
191
191
192
192
193
	$text = _DoItalicsAndBold($text);
193
	$text = _DoItalicsAndBold($text);
194
	
194
195
	# Do hard breaks:
195
	# Do hard breaks:
196
	$text = preg_replace('/ {2,}\n/', "<br$g_empty_element_suffix\n", $text);
196
	$text = preg_replace('/ {2,}\n/', "<br$g_empty_element_suffix\n", $text);
197
197
Lines 244-250 Link Here
244
		)
244
		)
245
		}xs",
245
		}xs",
246
		'_DoAnchors_reference_callback', $text);
246
		'_DoAnchors_reference_callback', $text);
247
	
247
248
	$text = preg_replace_callback("{
248
	$text = preg_replace_callback("{
249
		(				# wrap whole match in $1
249
		(				# wrap whole match in $1
250
		  \\[
250
		  \\[
Lines 263-269 Link Here
263
		)
263
		)
264
		}xs",
264
		}xs",
265
		'_DoAnchors_inline_callback', $text);
265
		'_DoAnchors_inline_callback', $text);
266
	
266
267
	return $text;
267
	return $text;
268
}
268
}
269
function _DoAnchors_reference_callback($matches) {
269
function _DoAnchors_reference_callback($matches) {
Lines 282-288 Link Here
282
		$url = str_replace(array('*',     '_'),
282
		$url = str_replace(array('*',     '_'),
283
						   array('&#42;', '&#95;'), $url);
283
						   array('&#42;', '&#95;'), $url);
284
		$result = "<a href='$url'";
284
		$result = "<a href='$url'";
285
		if ( isset( $g_title[$link_id] ) ) {
285
		if ( isset( $g_titles[$link_id] ) ) {
286
			$title = $g_titles[$link_id];
286
			$title = $g_titles[$link_id];
287
			$title = str_replace(array('*',     '_'),
287
			$title = str_replace(array('*',     '_'),
288
								 array('&#42;', '&#95;'), $title);
288
								 array('&#42;', '&#95;'), $title);
Lines 332-338 Link Here
332
		  \]
332
		  \]
333
333
334
		)
334
		)
335
		}xs', 
335
		}xs',
336
		'_DoImages_reference_callback', $text);
336
		'_DoImages_reference_callback', $text);
337
337
338
	#
338
	#
Lines 371-377 Link Here
371
	if ($link_id == "") {
371
	if ($link_id == "") {
372
		$link_id = strtolower($alt_text); # for shortcut links like ![this][].
372
		$link_id = strtolower($alt_text); # for shortcut links like ![this][].
373
	}
373
	}
374
	
374
375
	if (isset($g_urls[$link_id])) {
375
	if (isset($g_urls[$link_id])) {
376
		$url = $g_urls[$link_id];
376
		$url = $g_urls[$link_id];
377
		$url = str_replace(array('*',     '_'),
377
		$url = str_replace(array('*',     '_'),
Lines 531-537 Link Here
531
	$codeblock = $matches[4];
531
	$codeblock = $matches[4];
532
532
533
	$result; # return value
533
	$result; # return value
534
	
534
535
535
536
	$prefix = "";
536
	$prefix = "";
537
	if (!(preg_match('/\s/', $prevchar) || ($prevchar == ""))) {
537
	if (!(preg_match('/\s/', $prevchar) || ($prevchar == ""))) {
Lines 541-547 Link Here
541
	$codeblock = _Detab($codeblock);
541
	$codeblock = _Detab($codeblock);
542
	# trim leading newlines and trailing whitespace
542
	# trim leading newlines and trailing whitespace
543
	$codeblock = preg_replace(array('/\A\n+/', '/\s+\z/'), '', $codeblock);
543
	$codeblock = preg_replace(array('/\A\n+/', '/\s+\z/'), '', $codeblock);
544
	
544
545
	$result = $prefix . "\n\n<pre><code>" . $codeblock . "\n</code></pre>\n\n";
545
	$result = $prefix . "\n\n<pre><code>" . $codeblock . "\n</code></pre>\n\n";
546
546
547
	return $result;
547
	return $result;
Lines 578-588 Link Here
578
	$_ = str_replace('&', '&amp;', $_);
578
	$_ = str_replace('&', '&amp;', $_);
579
579
580
	# Do the angle bracket song and dance:
580
	# Do the angle bracket song and dance:
581
	$_ = str_replace(array('<',    '>'), 
581
	$_ = str_replace(array('<',    '>'),
582
					 array('&lt;', '&gt;'), $_);
582
					 array('&lt;', '&gt;'), $_);
583
583
584
	# Now, escape characters that are magic in Markdown:
584
	# Now, escape characters that are magic in Markdown:
585
	$_ = str_replace(array_keys($g_escape_table), 
585
	$_ = str_replace(array_keys($g_escape_table),
586
					 array_values($g_escape_table), $_);
586
					 array_values($g_escape_table), $_);
587
587
588
	return $_;
588
	return $_;
Lines 618-627 Link Here
618
}
618
}
619
function _DoBlockQuotes_callback($matches) {
619
function _DoBlockQuotes_callback($matches) {
620
	$bq = $matches[1];
620
	$bq = $matches[1];
621
	$bq = preg_replace('/^[ \t]*>[ \t]?/m', '', $bq); 
621
	$bq = preg_replace('/^[ \t]*>[ \t]?/m', '', $bq);
622
	$bq = _RunBlockGamut($bq);		# recurse
622
	$bq = _RunBlockGamut($bq);		# recurse
623
	$bq = preg_replace('/^/m', "\t", $bq);
623
	$bq = preg_replace('/^/m', "\t", $bq);
624
	
624
625
	return "<blockquote>\n$bq\n</blockquote>\n\n";
625
	return "<blockquote>\n$bq\n</blockquote>\n\n";
626
}
626
}
627
627
Lines 657-663 Link Here
657
657
658
658
659
function _EncodeAmpsAndAngles($text) {
659
function _EncodeAmpsAndAngles($text) {
660
	$text = preg_replace('/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w{1,8});)/', 
660
	$text = preg_replace('/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w{1,8});)/',
661
						 '&amp;', $text);;
661
						 '&amp;', $text);;
662
662
663
	# Encode naked <'s
663
	# Encode naked <'s
Lines 676-684 Link Here
676
676
677
677
678
function _DoAutoLinks($text) {
678
function _DoAutoLinks($text) {
679
	$text = preg_replace("!<((https?|ftp):[^'\">\\s]+)>!", 
679
	$text = preg_replace("!<((https?|ftp):[^'\">\\s]+)>!",
680
						 '<a href="\1">\1</a>', $text);
680
						 '<a href="\1">\1</a>', $text);
681
	
681
682
	# Email addresses: <address@domain.foo>
682
	# Email addresses: <address@domain.foo>
683
	$text = preg_replace('{
683
	$text = preg_replace('{
684
		<
684
		<
Lines 691-697 Link Here
691
		}exi',
691
		}exi',
692
		"_EncodeEmailAddress(_UnescapeSpecialChars(_UnslashQuotes('\\1')))",
692
		"_EncodeEmailAddress(_UnescapeSpecialChars(_UnslashQuotes('\\1')))",
693
		$text);
693
		$text);
694
	
694
695
	return $text;
695
	return $text;
696
}
696
}
697
697
Lines 700-706 Link Here
700
	$addr = "mailto:" . $addr;
700
	$addr = "mailto:" . $addr;
701
	$length = strlen($addr);
701
	$length = strlen($addr);
702
702
703
	$addr = preg_replace_callback('/([^\:])/', 
703
	$addr = preg_replace_callback('/([^\:])/',
704
								  '_EncodeEmailAddress_callback', $addr);
704
								  '_EncodeEmailAddress_callback', $addr);
705
705
706
	$addr = "<a href=\"$addr\">$addr</a>";
706
	$addr = "<a href=\"$addr\">$addr</a>";
Lines 719-725 Link Here
719
719
720
function _UnescapeSpecialChars($text) {
720
function _UnescapeSpecialChars($text) {
721
	global $g_escape_table;
721
	global $g_escape_table;
722
	return str_replace(array_values($g_escape_table), 
722
	return str_replace(array_values($g_escape_table),
723
					   array_keys($g_escape_table), $text);
723
					   array_keys($g_escape_table), $text);
724
}
724
}
725
725
Lines 735-742 Link Here
735
	$match = "(?s:<!(--.*?--\s*)+>)|".  # comment
735
	$match = "(?s:<!(--.*?--\s*)+>)|".  # comment
736
			 "(?s:<\?.*?\?>)|".         # processing instruction
736
			 "(?s:<\?.*?\?>)|".         # processing instruction
737
			 "$nested_tags";            # nested tags
737
			 "$nested_tags";            # nested tags
738
	
738
739
	preg_match_all("/($match)/", $str, $matches, 
739
	preg_match_all("/($match)/", $str, $matches,
740
				   PREG_SET_ORDER | PREG_OFFSET_CAPTURE);
740
				   PREG_SET_ORDER | PREG_OFFSET_CAPTURE);
741
741
742
	foreach ($matches as $element) {
742
	foreach ($matches as $element) {
Lines 744-758 Link Here
744
		$tag_start = $element[0][1];
744
		$tag_start = $element[0][1];
745
		$sec_start = $tag_start + strlen($whole_tag);
745
		$sec_start = $tag_start + strlen($whole_tag);
746
		if ($pos < $tag_start) {
746
		if ($pos < $tag_start) {
747
			array_push($tokens, array('text', 
747
			array_push($tokens, array('text',
748
					   substr($str, $pos, $tag_start - $pos)));
748
					   substr($str, $pos, $tag_start - $pos)));
749
		}
749
		}
750
		array_push($tokens, array('tag', $whole_tag));
750
		array_push($tokens, array('tag', $whole_tag));
751
		$pos = $sec_start;
751
		$pos = $sec_start;
752
	}
752
	}
753
	
753
754
	if ($pos < $len)
754
	if ($pos < $len)
755
		array_push($tokens, array('text', 
755
		array_push($tokens, array('text',
756
				   substr($str, $pos, $len - $pos)));
756
				   substr($str, $pos, $len - $pos)));
757
	return $tokens;
757
	return $tokens;
758
}
758
}
(-)wordpress/wp-includes/links-update-xml.php (-2 / +2 lines)
Lines 3-9 Link Here
3
// Copyright (C) 2003 Mike Little -- mike@zed1.com
3
// Copyright (C) 2003 Mike Little -- mike@zed1.com
4
4
5
// Get the path of our parent directory:
5
// Get the path of our parent directory:
6
$parentpath = dirname(dirname(__FILE__));
6
$parentpath = "../";
7
7
8
require_once($parentpath.'/wp-config.php');
8
require_once($parentpath.'/wp-config.php');
9
9
Lines 171-174 Link Here
171
	//echo('</pre>');
171
	//echo('</pre>');
172
} // end if updated cache file
172
} // end if updated cache file
173
173
174
?>
174
?>
(-)wordpress/wp-login.php (-9 / +9 lines)
Lines 1-5 Link Here
1
<?php
1
<?php
2
require(dirname(__FILE__) . '/wp-config.php');
2
require('./wp-config.php');
3
3
4
if (!function_exists('add_magic_quotes')) {
4
if (!function_exists('add_magic_quotes')) {
5
	function add_magic_quotes($array) {
5
	function add_magic_quotes($array) {
Lines 11-17 Link Here
11
			}
11
			}
12
		}
12
		}
13
		return $array;
13
		return $array;
14
	} 
14
	}
15
}
15
}
16
16
17
if (!get_magic_quotes_gpc()) {
17
if (!get_magic_quotes_gpc()) {
Lines 63-71 Link Here
63
		$pwd = $_POST['pwd'];
63
		$pwd = $_POST['pwd'];
64
		$redirect_to = $_POST['redirect_to'];
64
		$redirect_to = $_POST['redirect_to'];
65
	}
65
	}
66
	
66
67
	$user = get_userdatabylogin($log);
67
	$user = get_userdatabylogin($log);
68
	
68
69
	if (0 == $user->user_level) {
69
	if (0 == $user->user_level) {
70
		$redirect_to = get_settings('siteurl') . '/wp-admin/profile.php';
70
		$redirect_to = get_settings('siteurl') . '/wp-admin/profile.php';
71
	}
71
	}
Lines 87-93 Link Here
87
		}
87
		}
88
88
89
		$query = "SELECT ID, user_login, user_pass FROM $tableusers WHERE user_login = '$user_login' AND user_pass = '$password'";
89
		$query = "SELECT ID, user_login, user_pass FROM $tableusers WHERE user_login = '$user_login' AND user_pass = '$password'";
90
	
90
91
		$login = $wpdb->get_row($query);
91
		$login = $wpdb->get_row($query);
92
92
93
		if (!$login) {
93
		if (!$login) {
Lines 201-207 Link Here
201
	$user_login = $_POST["user_login"];
201
	$user_login = $_POST["user_login"];
202
	$user_data = get_userdatabylogin($user_login);
202
	$user_data = get_userdatabylogin($user_login);
203
	// redefining user_login ensures we return the right case in the email
203
	// redefining user_login ensures we return the right case in the email
204
	$user_login = $user_data['user_login'];
204
	$user_login = $user_data->user_login;
205
	$user_email = $user_data->user_email;
205
	$user_email = $user_data->user_email;
206
206
207
	if (!$user_email || $user_email != $_POST['email']) die(sprintf(__('Sorry, that user does not seem to exist in our database. Perhaps you have the wrong username or email address? <a href="%s">Try again</a>.'), 'wp-login.php?action=lostpassword'));
207
	if (!$user_email || $user_email != $_POST['email']) die(sprintf(__('Sorry, that user does not seem to exist in our database. Perhaps you have the wrong username or email address? <a href="%s">Try again</a>.'), 'wp-login.php?action=lostpassword'));
Lines 213-219 Link Here
213
	$message .= "Password: $user_pass\r\n";
213
	$message .= "Password: $user_pass\r\n";
214
	$message .= 'Login at: ' . get_settings('siteurl') . '/wp-login.php';
214
	$message .= 'Login at: ' . get_settings('siteurl') . '/wp-login.php';
215
215
216
	$m = mail($user_email, '[' . get_settings('blogname') . "] Your weblog's login/password", $message);
216
	$m = mail($user_email, '[' . get_settings('blogname') . "] Your weblog's login/password", $message, 'From: ' .get_settings('blogname'). ' WordPress Admin <' .get_settings('admin_email'). '>');
217
217
218
	if ($m == false) {
218
	if ($m == false) {
219
		echo "<p>The email could not be sent.<br />\n";
219
		echo "<p>The email could not be sent.<br />\n";
Lines 223-229 Link Here
223
		echo "<p>The email was sent successfully to $user_login's email address.<br />
223
		echo "<p>The email was sent successfully to $user_login's email address.<br />
224
		<a href='wp-login.php' title='Check your email first, of course'>Click here to login!</a></p>";
224
		<a href='wp-login.php' title='Check your email first, of course'>Click here to login!</a></p>";
225
		// send a copy of password change notification to the admin
225
		// send a copy of password change notification to the admin
226
		mail(get_settings('admin_email'), '[' . get_settings('blogname') . "] Password Lost/Change", "Password Lost and Changed for user: $user_login");
226
		 mail(get_settings('admin_email'), '[' . get_settings('blogname') . "] Password Lost/Change", "Password Lost and Changed for user: $user_login", 'From: ' .get_settings('blogname'). ' WordPress <' .get_settings('admin_email'). '>');
227
		die();
227
		die();
228
	}
228
	}
229
229
Lines 247-253 Link Here
247
		} else {
247
		} else {
248
			return true;
248
			return true;
249
		}
249
		}
250
	} 
250
	}
251
251
252
	if ( !(checklogin()) ) {
252
	if ( !(checklogin()) ) {
253
		if (!empty($_COOKIE['wordpressuser_'.$cookiehash])) {
253
		if (!empty($_COOKIE['wordpressuser_'.$cookiehash])) {
(-)wordpress/wp-mail.php (-3 / +3 lines)
Lines 1-7 Link Here
1
<?php
1
<?php
2
require(dirname(__FILE__) . '/wp-config.php');
2
require('./wp-config.php');
3
3
4
require_once(ABSPATH.WPINC.'/class-pop3.php');
4
require_once('wp-includes/class-pop3.php');
5
5
6
error_reporting(2037);
6
error_reporting(2037);
7
7
Lines 154-157 Link Here
154
154
155
$pop3->quit();
155
$pop3->quit();
156
156
157
?>
157
?>
(-)wordpress/wp-pass.php (-1 / +1 lines)
Lines 4-10 Link Here
4
  It doesn't need to connect to the DB, or do anything fancy at all. Yum.
4
  It doesn't need to connect to the DB, or do anything fancy at all. Yum.
5
  -- Matt
5
  -- Matt
6
*/
6
*/
7
require(dirname(__FILE__) . '/wp-config.php');
7
require('./wp-config.php');
8
setcookie('wp-postpass_'.$cookiehash, $_POST['post_password'], time()+60*60*24*30);
8
setcookie('wp-postpass_'.$cookiehash, $_POST['post_password'], time()+60*60*24*30);
9
header('Location: ' . $_SERVER['HTTP_REFERER']);
9
header('Location: ' . $_SERVER['HTTP_REFERER']);
10
10
(-)wordpress/wp-rdf.php (-2 / +2 lines)
Lines 2-8 Link Here
2
if (! $feed) {
2
if (! $feed) {
3
    $blog = 1; // enter your blog's ID
3
    $blog = 1; // enter your blog's ID
4
    $doing_rss = 1;
4
    $doing_rss = 1;
5
    require('wp-blog-header.php');
5
    require('./wp-blog-header.php');
6
}
6
}
7
$more = 1;
7
$more = 1;
8
8
Lines 51-57 Link Here
51
	<description><?php the_content_rss('', 0, '', get_settings('rss_excerpt_length'), 2) ?></description>
51
	<description><?php the_content_rss('', 0, '', get_settings('rss_excerpt_length'), 2) ?></description>
52
	<content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded>
52
	<content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded>
53
<?php endif; ?>
53
<?php endif; ?>
54
	
54
55
</item>
55
</item>
56
<?php } }  ?>
56
<?php } }  ?>
57
</rdf:RDF>
57
</rdf:RDF>
(-)wordpress/wp-rss.php (-2 / +2 lines)
Lines 3-9 Link Here
3
if (! $feed) {
3
if (! $feed) {
4
    $blog = 1; // enter your blog's ID
4
    $blog = 1; // enter your blog's ID
5
    $doing_rss = 1;
5
    $doing_rss = 1;
6
    require('wp-blog-header.php');
6
    require('./wp-blog-header.php');
7
}
7
}
8
8
9
header('Content-type: text/xml', true);
9
header('Content-type: text/xml', true);
Lines 26-32 Link Here
26
// we might use this in the future, but not now, that's why it's commented in PHP
26
// we might use this in the future, but not now, that's why it's commented in PHP
27
// so that it doesn't appear at all in the RSS
27
// so that it doesn't appear at all in the RSS
28
//          echo "<category>"; the_category_unicode(); echo "</category>";
28
//          echo "<category>"; the_category_unicode(); echo "</category>";
29
$more = 1; 
29
$more = 1;
30
if (get_settings('rss_use_excerpt')) {
30
if (get_settings('rss_use_excerpt')) {
31
?>
31
?>
32
            <description><?php the_excerpt_rss(get_settings('rss_excerpt_length'), 2) ?></description>
32
            <description><?php the_excerpt_rss(get_settings('rss_excerpt_length'), 2) ?></description>
(-)wordpress/wp-rss2.php (-3 / +3 lines)
Lines 1-8 Link Here
1
<?php 
1
<?php
2
if (!isset($feed)) {
2
if (!isset($feed)) {
3
    $blog = 1;
3
    $blog = 1;
4
    $doing_rss = 1;
4
    $doing_rss = 1;
5
    require('wp-blog-header.php');
5
    require('./wp-blog-header.php');
6
}
6
}
7
$more = 1;
7
$more = 1;
8
$charset = get_settings('blog_charset');
8
$charset = get_settings('blog_charset');
Lines 13-19 Link Here
13
<?php echo '<?xml version="1.0" encoding="' . $charset . '"?'.'>'; ?>
13
<?php echo '<?xml version="1.0" encoding="' . $charset . '"?'.'>'; ?>
14
14
15
<!-- generator="wordpress/<?php echo $wp_version ?>" -->
15
<!-- generator="wordpress/<?php echo $wp_version ?>" -->
16
<rss version="2.0" 
16
<rss version="2.0"
17
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
17
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
18
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
18
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
19
>
19
>
(-)wordpress/wp-trackback.php (-2 / +2 lines)
Lines 1-5 Link Here
1
<?php
1
<?php
2
require(dirname(__FILE__) . '/wp-config.php');
2
require('./wp-config.php');
3
3
4
// trackback is done by a POST
4
// trackback is done by a POST
5
$request_array = 'HTTP_POST_VARS';
5
$request_array = 'HTTP_POST_VARS';
Lines 88-91 Link Here
88
		do_action('trackback_post', $comment_ID);
88
		do_action('trackback_post', $comment_ID);
89
	}
89
	}
90
}
90
}
91
?>
91
?>

Return to bug 53051