HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: /home/mirz4654/public_html/wp-content/plugins/wp-pagenavi/scb/Hooks.php
<?php
/**
 * Automatic filter binding.
 */
class scbHooks {
	private static $mangle_name;

	/**
	 * Adds.
	 *
	 * @param string $class
	 *
	 * @return void
	 */
	public static function add( $class ) {
		self::_do( 'add_filter', $class );
	}

	/**
	 * Removes.
	 *
	 * @param string $class
	 *
	 * @return void
	 */
	public static function remove( $class ) {
		self::_do( 'remove_filter', $class );
	}

	/**
	 * Prints debug.
	 *
	 * @param string $class
	 * @param string $mangle_name (optional)
	 *
	 * @return void
	 */
	public static function debug( $class, $mangle_name = false ) {
		self::$mangle_name = $mangle_name;

		echo "<pre>";
		self::_do( array( __CLASS__, '_print' ), $class );
		echo "</pre>";
	}

	/**
	 * Prints.
	 *
	 * @param string $tag
	 * @param array $callback
	 * @param int $prio
	 * @param int $argc
	 *
	 * @return void
	 */
	private static function _print( $tag, $callback, $prio, $argc ) {
		$static = ! is_object( $callback[0] );

		if ( self::$mangle_name ) {
			$class = $static ? '__CLASS__' : '$this';
		} else if ( $static ) {
			$class = "'" . $callback[0] . "'";
		} else {
			$class = '$' . get_class( $callback[0] );
		}

		$func = "array( $class, '$callback[1]' )";

		echo "add_filter( '$tag', $func";

		if ( $prio != 10 || $argc > 1 ) {
			echo ", $prio";

			if ( $argc > 1 ) {
				echo ", $argc";
			}
		}

		echo " );\n";
	}

	/**
	 * Processes.
	 *
	 * @param string $action
	 * @param string $class
	 *
	 * @return void
	 */
	private static function _do( $action, $class ) {
		$reflection = new ReflectionClass( $class );

		foreach ( $reflection->getMethods() as $method ) {
			if ( $method->isPublic() && ! $method->isConstructor() ) {
				$comment = $method->getDocComment();

				if ( preg_match( '/@nohook[ \t\*\n]+/', $comment ) ) {
					continue;
				}

				preg_match_all( '/@hook:?\s+([^\s]+)/', $comment, $matches ) ? $matches[1] : $method->name;
				if ( empty( $matches[1] ) ) {
					$hooks = array( $method->name );
				} else {
					$hooks = $matches[1];
				}

				$priority = preg_match( '/@priority:?\s+(\d+)/', $comment, $matches ) ? $matches[1] : 10;

				foreach ( $hooks as $hook ) {
					call_user_func( $action, $hook, array( $class, $method->name ), $priority, $method->getNumberOfParameters() );
				}
			}
		}

	}

}