GRAYBYTE WORDPRESS FILE MANAGER2533

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/giriqfky/universaltoursandtravels.co.in/wp-content/plugins/seraphinite-accelerator/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/universaltoursandtravels.co.in/wp-content/plugins/seraphinite-accelerator//sql.php
<?php

namespace seraph_accel;

if( !defined( 'ABSPATH' ) )
	exit;

spl_autoload_register(
	function( $class )
	{
		if( strpos( $class, 'seraph_accel\\PHPSQLParser' ) === 0 )
			@include_once( __DIR__ . '/Cmn/Ext/PHP/' . str_replace( '\\', '/', substr( $class, 13 ) ) . '.php' );
	}
);

function Sql_Val2QueryStr( $v )
{
	if( is_string( $v ) )
		return( '\'' . esc_sql( $v ) . '\'' );
	return( esc_sql( '' . $v ) );
}

function _Sql_GetNoquotesName( $v )
{
	return( Gen::GetArrField( $v, array( 'no_quotes', 'parts', 0 ) ) );
}

function _Sql_GetVal( $v )
{
	$v = Gen::GetArrField( $v, array( 'base_expr' ) );
	if( substr( $v, 0, 1 ) == '\'' )
		return( @trim( $v, '\'' ) );
	return( @floatval( $v ) );
}

function Sql_GetWhereVals( array &$vals, array $where )
{
	https:

	$exprFirst = (isset($where[ 0 ])?$where[ 0 ]:null);

	if( Gen::GetArrField( $exprFirst, array( 'expr_type' ) ) == 'operator' && Gen::GetArrField( $exprFirst, array( 'base_expr' ) ) == 'NOT' )
		return( array() );

	$whereItem = array();
	$whereItems = array();
	foreach( $where as $expr )
	{
		$exprType = Gen::GetArrField( $expr, array( 'expr_type' ) );
		$exprName = Gen::GetArrField( $expr, array( 'base_expr' ) );

		if( $exprType == 'operator' )
		{
			if( $exprName == 'AND' )
			{
				if( $whereItem )
				{
					$whereItems[] = $whereItem;
					$whereItem = array();
				}

				continue;
			}
			else if( $exprName != '=' )
				return( null );
		}

		$whereItem[] = $expr;
	}

	if( $whereItem )
		$whereItems[] = $whereItem;

	foreach( $whereItems as $whereItem )
	{
		$col = (isset($whereItem[ 0 ])?$whereItem[ 0 ]:null);
		if( Gen::GetArrField( $col, array( 'expr_type' ) ) != 'colref' )
			continue;

		$colName = _Sql_GetNoquotesName( $col );

		$operator = (isset($whereItem[ 1 ])?$whereItem[ 1 ]:null);
		if( !$operator || Gen::GetArrField( $operator, array( 'expr_type' ) ) != 'operator' || Gen::GetArrField( $operator, array( 'base_expr' ) ) != '=' )
			continue;

		$val = (isset($whereItem[ 2 ])?$whereItem[ 2 ]:null);
		if( Gen::GetArrField( $val, array( 'expr_type' ) ) != 'const' )
			continue;

		$colVal = _Sql_GetVal( $val );
		$vals[ $colName ] = $colVal;
	}

	return( $vals );
}

function Sql_GetQueryModificationInfo( $query )
{
	$oper = @strtoupper( @substr( $query, 0, 7 + 1 ) );
	$operFound = false;
	foreach( array( 'INSERT', 'DELETE', 'UPDATE', 'REPLACE' ) as $opCode )
	{
		if( @strpos( $oper, $opCode . ' ' ) === 0 )
		{
			$oper = $opCode;
			$operFound = true;
			break;
		}
	}

	if( !$operFound )
		return( null );

	$parseRes = null;
	try { $parseRes = new PHPSQLParser\PHPSQLParser( $query, true ); } catch( \Exception $e ) {}

	if( !$parseRes || !$parseRes -> parsed )
		return( null );

	$parseRes = $parseRes -> parsed;

	switch( $oper )
	{
	case 'INSERT':
	case 'REPLACE':
	{

		if( Gen::GetArrField( $parseRes, array( $oper, 0, 'base_expr' ) ) != 'INTO' )
			return( null );

		$table = Gen::GetArrField( $parseRes, array( $oper, 1 ) );
		if( Gen::GetArrField( $table, array( 'expr_type' ) ) != 'table' )
			return( null );
		$table = _Sql_GetNoquotesName( $table );

		{
			$colList = Gen::GetArrField( $parseRes, array( $oper, 2 ), array() );
			if( Gen::GetArrField( $colList, array( 'expr_type' ) ) != 'column-list' )
				return( null );
			$colList = Gen::GetArrField( $colList, array( 'sub_tree' ), array() );
		}

		{
			$colVals = Gen::GetArrField( $parseRes, array( 'VALUES', 0 ), array() );
			if( Gen::GetArrField( $colVals, array( 'expr_type' ) ) != 'record' )
				return( null );
			$colVals = Gen::GetArrField( $colVals, array( 'data' ), array() );
		}

		$vals = array();
		foreach( $colList as $colIdx => $col )
		{
			if( Gen::GetArrField( $col, array( 'expr_type' ) ) != 'colref' )
				continue;

			$colName = _Sql_GetNoquotesName( $col );
			if( !$colName )
				return( null );

			$colVal = _Sql_GetVal( (isset($colVals[ $colIdx ])?$colVals[ $colIdx ]:null) );
			$vals[ $colName ] = $colVal;
		}

	} break;

	case 'UPDATE':
	{

		$tables = Gen::GetArrField( $parseRes, array( $oper ), array() );
		if( count( $tables ) != 1 )
			return( null );

		$table = (isset($tables[ 0 ])?$tables[ 0 ]:null);
		if( Gen::GetArrField( $table, array( 'expr_type' ) ) != 'table' )
			return( null );
		$table = _Sql_GetNoquotesName( $table );

		$vals = array();

		Sql_GetWhereVals( $vals, Gen::GetArrField( $parseRes, array( 'WHERE' ), array() ) );

		foreach( Gen::GetArrField( $parseRes, array( 'SET' ), array() ) as $colIdx => $col )
		{
			if( Gen::GetArrField( $col, array( 'expr_type' ) ) != 'expression' )
				continue;

			$colArgs = Gen::GetArrField( $col, array( 'sub_tree' ), array() );
			if( count( $colArgs ) != 3 )
				continue;

			$colOp = (isset($colArgs[ 1 ])?$colArgs[ 1 ]:null);
			if( Gen::GetArrField( $colOp, array( 'expr_type' ) ) != 'operator' || Gen::GetArrField( $colOp, array( 'base_expr' ) ) != '=' )
				continue;

			$colName = (isset($colArgs[ 0 ])?$colArgs[ 0 ]:null);
			if( Gen::GetArrField( $colName, array( 'expr_type' ) ) != 'colref' )
				continue;

			$colVal = (isset($colArgs[ 2 ])?$colArgs[ 2 ]:null);
			if( Gen::GetArrField( $colVal, array( 'expr_type' ) ) != 'const' )
				continue;

			$colName = _Sql_GetNoquotesName( $colName );
			if( !$colName )
				continue;

			$colVal = _Sql_GetVal( $colVal );
			$vals[ $colName ] = $colVal;
		}

	} break;

	case 'DELETE':
	{

		$tables = Gen::GetArrField( $parseRes, array( 'FROM' ), array() );
		if( count( $tables ) != 1 )
			return( null );

		$table = (isset($tables[ 0 ])?$tables[ 0 ]:null);
		if( Gen::GetArrField( $table, array( 'expr_type' ) ) != 'table' )
			return( null );
		$table = _Sql_GetNoquotesName( $table );

		$vals = array();

		Sql_GetWhereVals( $vals, Gen::GetArrField( $parseRes, array( 'WHERE' ), array() ) );

	} break;
	}

	return( array( 'table' => $table, 'oper' => $oper, 'data' => $vals ) );
}


[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 11 2025 13:53:58
giriqfky / giriqfky
0755
Cmn
--
July 01 2025 06:23:22
giriqfky / giriqfky
0755
Images
--
July 01 2025 06:23:22
giriqfky / giriqfky
0755
languages
--
July 01 2025 06:23:22
giriqfky / giriqfky
0755
Admin.js
24.951 KB
November 09 2024 05:34:01
giriqfky / giriqfky
0644
cache.php
50.874 KB
November 09 2024 05:34:01
giriqfky / giriqfky
0644
cache_ext.php
26.612 KB
November 09 2024 05:34:01
giriqfky / giriqfky
0644
cache_ext_CloudFlareHooksEx.php
0.887 KB
November 09 2024 05:34:01
giriqfky / giriqfky
0644
common.php
155.235 KB
November 09 2024 05:34:01
giriqfky / giriqfky
0644
content.php
101.892 KB
November 09 2024 05:34:01
giriqfky / giriqfky
0644
content_css.php
78.575 KB
November 09 2024 05:34:01
giriqfky / giriqfky
0644
content_css_ex.php
40.645 KB
November 09 2024 05:34:01
giriqfky / giriqfky
0644
content_frm.php
442.287 KB
November 09 2024 05:34:01
giriqfky / giriqfky
0644
content_img.php
41.418 KB
November 09 2024 05:34:01
giriqfky / giriqfky
0644
content_js.php
26.839 KB
November 09 2024 05:34:01
giriqfky / giriqfky
0644
htmlparser.php
47.269 KB
November 09 2024 05:34:01
giriqfky / giriqfky
0644
icon.png
0.257 KB
November 09 2024 05:34:01
giriqfky / giriqfky
0644
main.php
94.008 KB
November 09 2024 05:34:01
giriqfky / giriqfky
0644
oper.php
70.204 KB
November 09 2024 05:34:01
giriqfky / giriqfky
0644
options.php
326.101 KB
November 09 2024 05:34:01
giriqfky / giriqfky
0644
plugin_root.php
1.193 KB
November 09 2024 05:34:01
giriqfky / giriqfky
0644
re.php
9.965 KB
November 09 2024 05:34:01
giriqfky / giriqfky
0644
readme.txt
1.566 KB
November 09 2024 05:34:01
giriqfky / giriqfky
0644
sql.php
5.937 KB
November 09 2024 05:34:01
giriqfky / giriqfky
0644
third-party-software.html
35.169 KB
November 09 2024 05:34:01
giriqfky / giriqfky
0644
tune.php
71.1 KB
November 09 2024 05:34:01
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF