PluginProbe
Maps Plugin using Google Maps for WordPress – WP Google Map / trunk
Maps Plugin using Google Maps for WordPress – WP Google Map vtrunk
1.9.7 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.2 1.5.3 All 96 releases
gmap-embed / autoload.php

autoload.php in Maps Plugin using Google Maps for WordPress – WP Google Map trunk, at autoload.php

36 lines 1010 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 defined( 'ABSPATH' ) || exit;
3
4 spl_autoload_register(
5 function ($class) {
6 // project-specific namespace prefix
7 $prefix = 'WGMSRM\\';
8
9 // base directory for the namespace prefix
10 $base_dir = WGM_PLUGIN_PATH . 'includes/';
11
12 // does the class use the namespace prefix?
13 $len = strlen($prefix);
14 if (strncmp($prefix, $class, $len) !== 0) {
15 // no, move to the next registered autoloader
16 return;
17 }
18
19 // get the relative class name
20 $relative_class = substr($class, $len);
21
22 // Sanitize the relative class path to prevent directory traversal
23 $relative_class = str_replace(array('../', '..\\'), '', $relative_class);
24
25 // replace the namespace prefix with the base directory, replace namespace
26 // separators with directory separators in the relative class name, append
27 // with .php
28 $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';
29
30 // if the file exists, require it
31 if (file_exists($file)) {
32 require $file;
33 }
34 }
35 );
36