Insert Pages - Version 3.2.6

Version Description

  • Fix for custom templates issues on certain platforms (e.g., Windows).
Download this release

Release Info

Developer figureone
Plugin Icon wp plugin Insert Pages
Version 3.2.6
Comparing to
See all releases

Code changes from version 3.2.5 to 3.2.6

Files changed (2) hide show
  1. insert-pages.php +19 -3
  2. readme.txt +3 -0
insert-pages.php CHANGED
@@ -9,7 +9,7 @@ Author URI: http://www.linkedin.com/in/paulrryan
9
  Text Domain: insert-pages
10
  Domain Path: /languages
11
  License: GPL2
12
- Version: 3.2.5
13
  */
14
 
15
  /* Copyright 2011 Paul Ryan (email: prar@hawaii.edu)
@@ -372,7 +372,15 @@ if ( !class_exists( 'InsertPagesPlugin' ) ) {
372
  // Only allow templates that don't have any directory traversal in
373
  // them (to prevent including php files that aren't in the active
374
  // theme directory or the /wp-includes/theme-compat/ directory).
375
- if ( strlen( $template ) > 0 && $template === realpath( $template ) ) {
 
 
 
 
 
 
 
 
376
  include $template; // execute the template code
377
  } else { // Couldn't find template, so fall back to printing a link to the page.
378
  the_post();
@@ -482,7 +490,15 @@ if ( !class_exists( 'InsertPagesPlugin' ) ) {
482
  // Only allow templates that don't have any directory traversal in
483
  // them (to prevent including php files that aren't in the active
484
  // theme directory or the /wp-includes/theme-compat/ directory).
485
- if ( strlen( $template ) > 0 && $template === realpath( $template ) ) {
 
 
 
 
 
 
 
 
486
  include $template; // execute the template code
487
  } else { // Couldn't find template, so fall back to printing a link to the page.
488
  the_post();
9
  Text Domain: insert-pages
10
  Domain Path: /languages
11
  License: GPL2
12
+ Version: 3.2.6
13
  */
14
 
15
  /* Copyright 2011 Paul Ryan (email: prar@hawaii.edu)
372
  // Only allow templates that don't have any directory traversal in
373
  // them (to prevent including php files that aren't in the active
374
  // theme directory or the /wp-includes/theme-compat/ directory).
375
+ $path_in_theme_or_childtheme_or_compat = (
376
+ // Template is in current theme folder.
377
+ 0 === strpos( realpath( $template ), realpath( STYLESHEETPATH ) ) ||
378
+ // Template is in current or parent theme folder.
379
+ 0 === strpos( realpath( $template ), realpath( TEMPLATEPATH ) ) ||
380
+ // Template is in theme-compat folder.
381
+ 0 === strpos( realpath( $template ), realpath( ABSPATH . WPINC . '/theme-compat/' ) )
382
+ );
383
+ if ( strlen( $template ) > 0 && $path_in_theme_or_childtheme_or_compat ) {
384
  include $template; // execute the template code
385
  } else { // Couldn't find template, so fall back to printing a link to the page.
386
  the_post();
490
  // Only allow templates that don't have any directory traversal in
491
  // them (to prevent including php files that aren't in the active
492
  // theme directory or the /wp-includes/theme-compat/ directory).
493
+ $path_in_theme_or_childtheme_or_compat = (
494
+ // Template is in current theme folder.
495
+ 0 === strpos( realpath( $template ), realpath( STYLESHEETPATH ) ) ||
496
+ // Template is in current or parent theme folder.
497
+ 0 === strpos( realpath( $template ), realpath( TEMPLATEPATH ) ) ||
498
+ // Template is in theme-compat folder.
499
+ 0 === strpos( realpath( $template ), realpath( ABSPATH . WPINC . '/theme-compat/' ) )
500
+ );
501
+ if ( strlen( $template ) > 0 && $path_in_theme_or_childtheme_or_compat ) {
502
  include $template; // execute the template code
503
  } else { // Couldn't find template, so fall back to printing a link to the page.
504
  the_post();
readme.txt CHANGED
@@ -86,6 +86,9 @@ Just one! The plugin prevents you from embedding a page in itself, but you can t
86
 
87
  == Changelog ==
88
 
 
 
 
89
  = 3.2.5 =
90
  * Support looking up hierarchical pages by slug; insert hierarchical pages by path (not slug).
91
  * Fix for php warning when displaying meta values that are strings instead of arrays.
86
 
87
  == Changelog ==
88
 
89
+ = 3.2.6 =
90
+ * Fix for custom templates issues on certain platforms (e.g., Windows).
91
+
92
  = 3.2.5 =
93
  * Support looking up hierarchical pages by slug; insert hierarchical pages by path (not slug).
94
  * Fix for php warning when displaying meta values that are strings instead of arrays.