<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -875,13 +875,13 @@ function preview_theme() {
 	if ( validate_file($_GET['template']) )
 		return;
 
-	add_filter( 'template', create_function('', &quot;return '{$_GET['template']}';&quot;) );
+	add_filter( 'template', '_preview_theme_template_filter' );
 
 	if ( isset($_GET['stylesheet']) ) {
 		$_GET['stylesheet'] = preg_replace('|[^a-z0-9_./-]|i', '', $_GET['stylesheet']);
 		if ( validate_file($_GET['stylesheet']) )
 			return;
-		add_filter( 'stylesheet', create_function('', &quot;return '{$_GET['stylesheet']}';&quot;) );
+		add_filter( 'stylesheet', '_preview_theme_stylesheet_filter' );
 	}
 
 	// Prevent theme mods to current theme being used on theme being previewed
@@ -892,6 +892,24 @@ function preview_theme() {
 add_action('setup_theme', 'preview_theme');
 
 /**
+ * Private function to modify the current template when previewing a theme
+ * 
+ * @return string
+ */
+function _preview_theme_template_filter() {
+	return isset($_GET['template']) ? $_GET['template'] : '';
+}
+
+/**
+ * Private function to modify the current stylesheet when previewing a theme
+ * 
+ * @return string
+ */
+function _preview_theme_stylesheet_filter() {
+	return isset($_GET['stylesheet']) ? $_GET['stylesheet'] : '';
+}
+
+/**
  * Callback function for ob_start() to capture all links in the theme.
  *
  * @since unknown</diff>
      <filename>wp-includes/theme.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>aeaafa32d2762a1f208281f27a544df74e11bc20</id>
    </parent>
  </parents>
  <author>
    <name>westi</name>
    <email>westi@1a063a9b-81f0-0310-95a4-ce76da25c4cd</email>
  </author>
  <url>http://github.com/blowery/wordpress/commit/15d5dbd44b9a029cbc1a0f9a613e0e06dd43ee65</url>
  <id>15d5dbd44b9a029cbc1a0f9a613e0e06dd43ee65</id>
  <committed-date>2009-10-20T10:05:42-07:00</committed-date>
  <authored-date>2009-10-20T10:05:42-07:00</authored-date>
  <message>Move theme preview away from using create_function and to predefined functions. See #10729 for 2.8 branch.

git-svn-id: http://svn.automattic.com/wordpress/branches/2.8@12070 1a063a9b-81f0-0310-95a4-ce76da25c4cd</message>
  <tree>bd7ab1421c71b7c71ce746e2ef016c0a8e6f401b</tree>
  <committer>
    <name>westi</name>
    <email>westi@1a063a9b-81f0-0310-95a4-ce76da25c4cd</email>
  </committer>
</commit>
