Changeset 2414811
- Timestamp:
- 11/08/2020 05:50:01 PM (5 years ago)
- Location:
- quant
- Files:
-
- 3 edited
-
tags/1.1.0/src/seed/CustomRoutesBatch.php (modified) (2 diffs)
-
trunk/quant.php (modified) (1 diff)
-
trunk/src/seed/CustomRoutesBatch.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
quant/tags/1.1.0/src/seed/CustomRoutesBatch.php
r2414596 r2414811 36 36 37 37 foreach ($routes as $i => $route) { 38 39 // Check for file on disk, disallow paths outside root. 40 $file = ABSPATH . strtok($route, '?'); 41 if (file_exists($file) && is_file($file) && strpos($file, '..') === false) { 42 $this->push( new Quant_WP_Batch_Item( $i, array( 'route' => $route, 'is_file' => true ) ) ); 43 continue; 44 } 45 46 // Assume content route. 38 47 $this->push( new Quant_WP_Batch_Item( $i, array( 'route' => $route ) ) ); 39 48 } … … 61 70 $route = $item->get_value( 'route' ); 62 71 $is_404 = $item->get_value( 'is_404' ); 72 $is_file = $item->get_value( 'is_file' ); 73 74 if ($is_file) { 75 $file = ABSPATH . strtok($route, '?'); 76 $this->client->file($route, $file); 77 return true; 78 } 63 79 64 80 if ($is_404) { -
quant/trunk/quant.php
r2414596 r2414811 6 6 * Author: Stuart Rowlands 7 7 * Plugin URI: https://www.quantcdn.io 8 * Version: 1. 0.08 * Version: 1.1.0 9 9 * License: GPL-2.0+ 10 10 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt -
quant/trunk/src/seed/CustomRoutesBatch.php
r2391375 r2414811 36 36 37 37 foreach ($routes as $i => $route) { 38 39 // Check for file on disk, disallow paths outside root. 40 $file = ABSPATH . strtok($route, '?'); 41 if (file_exists($file) && is_file($file) && strpos($file, '..') === false) { 42 $this->push( new Quant_WP_Batch_Item( $i, array( 'route' => $route, 'is_file' => true ) ) ); 43 continue; 44 } 45 46 // Assume content route. 38 47 $this->push( new Quant_WP_Batch_Item( $i, array( 'route' => $route ) ) ); 39 48 } … … 61 70 $route = $item->get_value( 'route' ); 62 71 $is_404 = $item->get_value( 'is_404' ); 72 $is_file = $item->get_value( 'is_file' ); 73 74 if ($is_file) { 75 $file = ABSPATH . strtok($route, '?'); 76 $this->client->file($route, $file); 77 return true; 78 } 63 79 64 80 if ($is_404) {
Note: See TracChangeset
for help on using the changeset viewer.