- WPCS for defined constants;

* um_url -> UM_URL
   * um_path -> UM_PATH
   * um_plugin -> UM_PLUGIN
   * ultimatemember_version -> UM_VERSION
   * ultimatemember_plugin_name -> UM_PLUGIN_NAME
This commit is contained in:
Mykyta Synelnikov
2023-09-13 22:56:32 +03:00
parent 57159f2496
commit b83da8b814
25 changed files with 213 additions and 213 deletions
+3 -3
View File
@@ -328,7 +328,7 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) {
// Avoid Directory Traversal vulnerability by the checking the realpath.
// Templates can be situated only in the get_stylesheet_directory() or plugindir templates.
$real_file = wp_normalize_path( realpath( $file ) );
if ( 0 === strpos( $real_file, wp_normalize_path( um_path . "templates" . DIRECTORY_SEPARATOR ) ) || 0 === strpos( $real_file, wp_normalize_path( get_stylesheet_directory() . DIRECTORY_SEPARATOR . 'ultimate-member' . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR ) ) ) {
if ( 0 === strpos( $real_file, wp_normalize_path( UM_PATH . "templates" . DIRECTORY_SEPARATOR ) ) || 0 === strpos( $real_file, wp_normalize_path( get_stylesheet_directory() . DIRECTORY_SEPARATOR . 'ultimate-member' . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR ) ) ) {
include $file;
}
}
@@ -1003,7 +1003,7 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) {
*/
function template_exists($template) {
$file = um_path . 'templates/' . $template . '.php';
$file = UM_PATH . 'templates/' . $template . '.php';
$theme_file = get_stylesheet_directory() . '/ultimate-member/templates/' . $template . '.php';
if (file_exists($theme_file) || file_exists($file)) {
@@ -1041,7 +1041,7 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) {
$array[ $excluded ] = __( 'Default Template', 'ultimate-member' );
}
$paths[] = glob( um_path . 'templates/' . '*.php' );
$paths[] = glob( UM_PATH . 'templates/' . '*.php' );
if ( file_exists( get_stylesheet_directory() . '/ultimate-member/templates/' ) ) {
$paths[] = glob( get_stylesheet_directory() . '/ultimate-member/templates/' . '*.php' );