/var/www/trendwave.io/bff/vendor/laminas/laminas-diactoros/src/HeaderSecurity.php
return true;
}
/**
* Assert a header value is valid.
*
* @param mixed $value Value to be tested. This method asserts it is a string or number.
* @throws Exception\InvalidArgumentException For invalid values.
*/
public static function assertValid($value): void
{
if (! is_string($value) && ! is_numeric($value)) {
throw new Exception\InvalidArgumentException(sprintf(
'Invalid header value type; must be a string or numeric; received %s',
is_object($value) ? get_class($value) : gettype($value)
));
}
if (! self::isValid($value)) {
throw new Exception\InvalidArgumentException(sprintf(
'"%s" is not valid header value',
$value
));
}
}
/**
* Assert whether or not a header name is valid.
*
* @see http://tools.ietf.org/html/rfc7230#section-3.2
*
* @param mixed $name
* @throws Exception\InvalidArgumentException
*/
public static function assertValidName($name): void
{
if (! is_string($name)) {
throw new Exception\InvalidArgumentException(sprintf(
'Invalid header name type; expected string; received %s',
is_object($name) ? get_class($name) : gettype($name)
/var/www/trendwave.io/bff/vendor/laminas/laminas-diactoros/src/MessageTrait.php
/**
* @param mixed $values
* @return string[]
*/
private function filterHeaderValue($values): array
{
if (! is_array($values)) {
$values = [$values];
}
if ([] === $values) {
throw new Exception\InvalidArgumentException(
'Invalid header value: must be a string or array of strings; '
. 'cannot be an empty array'
);
}
return array_map(static function ($value): string {
HeaderSecurity::assertValid($value);
$value = (string) $value;
// Normalize line folding to a single space (RFC 7230#3.2.4).
$value = str_replace(["\r\n\t", "\r\n "], ' ', $value);
// Remove optional whitespace (OWS, RFC 7230#3.2.3) around the header value.
return trim($value, "\t ");
}, array_values($values));
}
/**
* Ensure header name and values are valid.
*
* @param string $name
* @throws Exception\InvalidArgumentException
*/
private function assertHeader($name): void
{
HeaderSecurity::assertValidName($name);
/var/www/trendwave.io/bff/vendor/laminas/laminas-diactoros/src/MessageTrait.php
}
if ([] === $values) {
throw new Exception\InvalidArgumentException(
'Invalid header value: must be a string or array of strings; '
. 'cannot be an empty array'
);
}
return array_map(static function ($value): string {
HeaderSecurity::assertValid($value);
$value = (string) $value;
// Normalize line folding to a single space (RFC 7230#3.2.4).
$value = str_replace(["\r\n\t", "\r\n "], ' ', $value);
// Remove optional whitespace (OWS, RFC 7230#3.2.3) around the header value.
return trim($value, "\t ");
}, array_values($values));
}
/**
* Ensure header name and values are valid.
*
* @param string $name
* @throws Exception\InvalidArgumentException
*/
private function assertHeader($name): void
{
HeaderSecurity::assertValidName($name);
}
}
/var/www/trendwave.io/bff/vendor/laminas/laminas-diactoros/src/MessageTrait.php
. 'or a Psr\Http\Message\StreamInterface implementation'
);
}
return new Stream($stream, $modeIfNotInstance);
}
/**
* Filter a set of headers to ensure they are in the correct internal format.
*
* Used by message constructors to allow setting all initial headers at once.
*
* @param array $originalHeaders Headers to filter.
*/
private function setHeaders(array $originalHeaders): void
{
$headerNames = $headers = [];
foreach ($originalHeaders as $header => $value) {
$value = $this->filterHeaderValue($value);
$this->assertHeader($header);
$headerNames[strtolower($header)] = $header;
$headers[$header] = $value;
}
$this->headerNames = $headerNames;
$this->headers = $headers;
}
/**
* Validate the HTTP protocol version
*
* @param string $version
* @throws Exception\InvalidArgumentException On invalid HTTP protocol version.
*/
private function validateProtocolVersion($version): void
{
if (empty($version)) {
/var/www/trendwave.io/bff/vendor/laminas/laminas-diactoros/src/Response.php
510 => 'Not Extended (OBSOLETED)',
511 => 'Network Authentication Required',
599 => 'Network Connect Timeout Error',
];
private string $reasonPhrase;
private int $statusCode;
/**
* @param string|resource|StreamInterface $body Stream identifier and/or actual stream resource
* @param int $status Status code for the response, if any.
* @param array $headers Headers for the response, if any.
* @throws Exception\InvalidArgumentException On any invalid element.
*/
public function __construct($body = 'php://memory', int $status = 200, array $headers = [])
{
$this->setStatusCode($status);
$this->stream = $this->getStream($body, 'wb+');
$this->setHeaders($headers);
}
/**
* {@inheritdoc}
*/
public function getStatusCode(): int
{
return $this->statusCode;
}
/**
* {@inheritdoc}
*/
public function getReasonPhrase(): string
{
return $this->reasonPhrase;
}
/**
* {@inheritdoc}
/var/www/trendwave.io/bff/http/ResponseFactory.php
return $this->unify(
new JsonResponse($data, $status, $headers, $encodingOptions ?? JsonResponse::DEFAULT_JSON_FLAGS)
);
}
/**
* Create redirect response
* @param string|UriInterface $uri
* @param int $status
* @param array $headers
* @return \bff\http\RedirectResponse
*/
public function redirect($uri, int $status = 302, array $headers = [])
{
$headers['location'] = [
strval($uri)
];
return (new RedirectResponse(
'php://temp',
$status,
$headers
))->withCookies(
# Copy cookies from default response to newly created
$this->current()->getCookies()
);
}
/**
* Create basic authenticate response
* @param string|null $realm
* @param array $headers
* @return \bff\http\Response
*/
public function authBasic(?string $realm = null, array $headers = [])
{
$realm = $realm ?? Request::host();
$headers['WWW-Authenticate'] = 'Basic realm="' . $realm . '"';
/var/www/trendwave.io/bff/vendor/illuminate/support/Facades/Facade.php
}
/**
* Handle dynamic, static calls to the object.
*
* @param string $method
* @param array $args
* @return mixed
*
* @throws \RuntimeException
*/
public static function __callStatic($method, $args)
{
$instance = static::getFacadeRoot();
if (! $instance) {
throw new RuntimeException('A facade root has not been set.');
}
return $instance->$method(...$args);
}
}
/var/www/trendwave.io/bff/traits/Macroable.php
if ($this instanceof Module) {
return parent::__call($method, $parameters);
}
return null;
}
public static function __callStatic($method, $parameters)
{
# Allow Facades to be macroable
if (method_exists(static::class, 'getFacadeAccessor')) {
if (static::hasMacro($method)) {
$macro = static::$macros[$method];
if ($macro instanceof Closure) {
# Call method in facade root context
return call_user_func_array(Closure::bind($macro, static::getFacadeRoot()), $parameters);
}
return $macro(...$parameters);
} else {
return parent::__callStatic($method, $parameters);
}
}
return static::callBaseStatic($method, $parameters);
}
}
/var/www/trendwave.io/bff/http/RedirectFactory.php
protected $url;
public const STATUS_FOUND = 302;
public const STATUS_MOVED_PERMANENTLY = 301;
public function __construct(UrlManager $url)
{
$this->url = $url;
}
/**
* Make redirect response
* @param string $url
* @param int $status
* @param array $headers
* @return \bff\http\RedirectResponse
*/
protected function make(string $url, int $status = self::STATUS_FOUND, array $headers = [])
{
return Response::redirect($url, $status, $headers);
}
/**
* Redirect to Url
* @param string $path
* @param array $opts
* @return \bff\http\RedirectResponse
*/
public function to(string $path = '/', array $opts = [])
{
return $this->make(
$this->url->to($path, $opts),
$opts['status'] ?? self::STATUS_FOUND,
$opts['headers'] ?? []
);
}
/**
* Redirect to Route Url
* @param string $id route id
/var/www/trendwave.io/bff/http/RedirectFactory.php
* @param array $headers
* @return \bff\http\RedirectResponse
*/
protected function make(string $url, int $status = self::STATUS_FOUND, array $headers = [])
{
return Response::redirect($url, $status, $headers);
}
/**
* Redirect to Url
* @param string $path
* @param array $opts
* @return \bff\http\RedirectResponse
*/
public function to(string $path = '/', array $opts = [])
{
return $this->make(
$this->url->to($path, $opts),
$opts['status'] ?? self::STATUS_FOUND,
$opts['headers'] ?? []
);
}
/**
* Redirect to Route Url
* @param string $id route id
* @param array $params route params
* @param array $opts
* @return \bff\http\RedirectResponse
*/
public function route(string $id, array $params = [], array $opts = [])
{
return $this->make(
$this->url->route($id, $params, $opts),
$opts['status'] ?? self::STATUS_FOUND,
$opts['headers'] ?? []
);
}
/**
/var/www/trendwave.io/bff/base/Module.php
* @param string $title заголовок сообщения
* @param string|int|array $message текст сообщения или ID сообщения (Errors)
* @param array $opts ['auth' - требуется авторизация]
* @return string HTML
*/
public function showForbidden($title = '', $message = '', array $opts = [])
{
return $this->errors->messageForbidden($title, $message, $opts);
}
/**
* Redirect
* @param string|null $url full url / path / null
* @param array $opts
* @return \bff\http\RedirectResponse|\bff\http\RedirectFactory
*/
protected function redirect(?string $url = null, array $opts = [])
{
if (! is_null($url)) {
return $this->app->make('redirect')->to($url, $opts);
}
return $this->app->make('redirect');
}
/**
* Корректировка URL текущего запроса с последующим 301 редиректом
* @param string $url корректный URL
* @param array $opts параметры
* @return \bff\http\Response|bool
*/
public function urlCorrection(string $url, array $opts = [])
{
if ($this->isCron()) {
return false;
}
if (! array_key_exists('status', $opts)) {
$opts['status'] = 301;
}
return Request::urlCorrection($url, $opts);
}
/var/www/trendwave.io/plugins/listings_extlinks_p086b27/index.php
<?php //0009b
// Copyright Tamaranga. 2014-2022
// All Rights Reserved
echo('No IonCube Loader is installed. Please contact Tamaranga support.');exit(199);
?>
HR+cPvgxsxxErZ+nBBrEdGFGpWoQCc/s6GSs4UHq08ptoFxf7fcW7n6rPLGGmNDGWhK4ks3NE3EV
Hbej9YB4Z4SXNsPRMebcD79UExyV3Xm3tZODanBAPjUXW4FBfKjxKwcGe6OmidNReWo29X/tfPZd
O09VTdkBpn75ICPl7kkiLM1pjvGVLZ4fXGjujFoXkmtb95XOry/gjyMWhCW8KLlZFQmCyltCR+L+
aFB3dBG9jrYtXd1qASCzxqH669Xvhphg2XCrELn8ZrGcD507elvYSTK+uKrKS7QBqK/5DveX1p4P
TO4WZyfZTvSn8t1GIJaMzspMRu8h7Lr3rqgVuHp8g741M5QPrO6IEQyurnxCwU3U1we9NoNQdx/B
NFIcf+yM4bE7O+TpdbOeRmEGh7Gm8EemJgXIAg6kN6NhTYJjiIIKDn1EZp7ejwK+hNB6Pd8seAy1
t8RdY9QCpdn6kns1N2WABCtXpKb5PgWVXrcxVesuhNn6m9bw4afSOWTD3lONt93x5I1tyrvlaCcK
kssn8GjI43JQYsAMyaxQsE+X3vN4Rre6qPKO916YnmF/3iVdoLLtQYZWb0Ht/eJqEIylX6nMj+5I
8xDqL2RL4j8S6YFozRY1a+l+id1UsFRmB8h0fCW1Pdu3hzxpA24o79bp9qqH4y3juD9OnLSNmJ4X
IxeSTYh+DrIFte+fBrKUgnp9ovsOtxLppUO701y95Z0Bx7U3lHvnKoAt41eaaYzqDOeQpkJGeFI1
4y2K/UX9pdqL57/S8MpsPWKbhnNngmRWrOEqeqRldSa+1ZOOJkcIovx/9eyrsOB0avpGkCLLVDiO
yben40mMfrnBKs+sKVfV+aJN0q/sPPFL/Z57G0016cAUuutJpxhNe+IbOWIEtZjfTwSzluGVyNNS
TT5tWXdFatoS1NBcO/pYG0TkPTxtNrOjRdnyg4paQp8e9bGSRdLSzr+1xyoy7SuxdHheFwJUItr5
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HHUzjG5YelZhAX7a0IXmZbNqpeRwsAXNlSKpks+gBDWHfYvhF9xM3mr3gVnRiKxKW
tfCUFd4RdCaBZtLl9yQjocmbSVHu9FziB7DndBEKORzI7e6mFioKi2bqADf6by54oWdguIF5Q7LQ
8d7L9kGNbOsaQuisTyVLHhUu5CV6xNHyyBF0KaQ9BT9pVCt3K/bqkJeEoDOiwWweFy6yOe1fes7C
OyPUWNKUQ9y05hPeAQFCn5VgZJOrnOzR8A2utfea97zTCu7G/Maw9u9xfC0hMmsiQARgTgXHzE3V
uS8r+ukPW9Hnpqkufwpb+I4WKTnVUpQ14wSoYySAghs7YK3ailcuA8bAXPu0ofxKEMXxSiubwsPj
ntX1jgmeeKypu5KRv2E2fE9Aux78+iDCnWBlTTXcLVMxBJeYRLbMJfahGPb/CGlpVzbAq7+IFMW7
TTuZBclrndUq/P8Aw+UEnJvwCExm2BbPHe5OtJ/1A29e4IxpCbmP+8RZpEiXVZUH8ae67eKkp8H8
+T/9OoW5PZ5JeV8+gcWNvEPeqvFsgX4o4JihKsjIZvmtMLNbA5yu0akrkEdzc8dROSCMPD37sK49
/var/www/trendwave.io/bff/vendor/illuminate/container/BoundMethod.php
* @param callable|string $callback
* @param array $parameters
* @param string|null $defaultMethod
* @return mixed
*
* @throws \ReflectionException
* @throws \InvalidArgumentException
*/
public static function call($container, $callback, array $parameters = [], $defaultMethod = null)
{
if (is_string($callback) && ! $defaultMethod && method_exists($callback, '__invoke')) {
$defaultMethod = '__invoke';
}
if (static::isCallableWithAtSign($callback) || $defaultMethod) {
return static::callClass($container, $callback, $parameters, $defaultMethod);
}
return static::callBoundMethod($container, $callback, function () use ($container, $callback, $parameters) {
return $callback(...array_values(static::getMethodDependencies($container, $callback, $parameters)));
});
}
/**
* Call a string reference to a class using Class@method syntax.
*
* @param \Illuminate\Container\Container $container
* @param string $target
* @param array $parameters
* @param string|null $defaultMethod
* @return mixed
*
* @throws \InvalidArgumentException
*/
protected static function callClass($container, $target, array $parameters = [], $defaultMethod = null)
{
$segments = explode('@', $target);
// We will assume an @ sign is used to delimit the class name from the method
// name. We will split on this @ sign and then build a callable array that
/var/www/trendwave.io/bff/vendor/illuminate/container/Util.php
public static function arrayWrap($value)
{
if (is_null($value)) {
return [];
}
return is_array($value) ? $value : [$value];
}
/**
* Return the default value of the given value.
*
* From global value() helper in Illuminate\Support.
*
* @param mixed $value
* @return mixed
*/
public static function unwrapIfClosure($value)
{
return $value instanceof Closure ? $value() : $value;
}
/**
* Get the class name of the given parameter's type, if possible.
*
* From Reflector::getParameterClassName() in Illuminate\Support.
*
* @param \ReflectionParameter $parameter
* @return string|null
*/
public static function getParameterClassName($parameter)
{
$type = $parameter->getType();
if (! $type instanceof ReflectionNamedType || $type->isBuiltin()) {
return null;
}
$name = $type->getName();
/var/www/trendwave.io/bff/vendor/illuminate/container/BoundMethod.php
* @param callable $callback
* @param mixed $default
* @return mixed
*/
protected static function callBoundMethod($container, $callback, $default)
{
if (! is_array($callback)) {
return Util::unwrapIfClosure($default);
}
// Here we need to turn the array callable into a Class@method string we can use to
// examine the container and see if there are any method bindings for this given
// method. If there are, we can call this method binding callback immediately.
$method = static::normalizeMethod($callback);
if ($container->hasMethodBinding($method)) {
return $container->callMethodBinding($method, $callback[0]);
}
return Util::unwrapIfClosure($default);
}
/**
* Normalize the given callback into a Class@method string.
*
* @param callable $callback
* @return string
*/
protected static function normalizeMethod($callback)
{
$class = is_string($callback[0]) ? $callback[0] : get_class($callback[0]);
return "{$class}@{$callback[1]}";
}
/**
* Get all dependencies for a given method.
*
* @param \Illuminate\Container\Container $container
* @param callable|string $callback
/var/www/trendwave.io/bff/vendor/illuminate/container/BoundMethod.php
* @param array $parameters
* @param string|null $defaultMethod
* @return mixed
*
* @throws \ReflectionException
* @throws \InvalidArgumentException
*/
public static function call($container, $callback, array $parameters = [], $defaultMethod = null)
{
if (is_string($callback) && ! $defaultMethod && method_exists($callback, '__invoke')) {
$defaultMethod = '__invoke';
}
if (static::isCallableWithAtSign($callback) || $defaultMethod) {
return static::callClass($container, $callback, $parameters, $defaultMethod);
}
return static::callBoundMethod($container, $callback, function () use ($container, $callback, $parameters) {
return $callback(...array_values(static::getMethodDependencies($container, $callback, $parameters)));
});
}
/**
* Call a string reference to a class using Class@method syntax.
*
* @param \Illuminate\Container\Container $container
* @param string $target
* @param array $parameters
* @param string|null $defaultMethod
* @return mixed
*
* @throws \InvalidArgumentException
*/
protected static function callClass($container, $target, array $parameters = [], $defaultMethod = null)
{
$segments = explode('@', $target);
// We will assume an @ sign is used to delimit the class name from the method
// name. We will split on this @ sign and then build a callable array that
// we can pass right back into the "call" method for dependency binding.
/var/www/trendwave.io/bff/vendor/illuminate/container/Container.php
public function wrap(Closure $callback, array $parameters = [])
{
return function () use ($callback, $parameters) {
return $this->call($callback, $parameters);
};
}
/**
* Call the given Closure / class@method and inject its dependencies.
*
* @param callable|string $callback
* @param array<string, mixed> $parameters
* @param string|null $defaultMethod
* @return mixed
*
* @throws \InvalidArgumentException
*/
public function call($callback, array $parameters = [], $defaultMethod = null)
{
return BoundMethod::call($this, $callback, $parameters, $defaultMethod);
}
/**
* Get a closure to resolve the given type from the container.
*
* @param string $abstract
* @return \Closure
*/
public function factory($abstract)
{
return function () use ($abstract) {
return $this->make($abstract);
};
}
/**
* An alias function name for make().
*
* @param string|callable $abstract
* @param array $parameters
/var/www/trendwave.io/bff/base/Application.php
if ($this->frontend()) {
if (! $this->security()->isPublicMethod($name, $method)) {
return Site::showAccessDenied();
}
} elseif ($this->adminPanel()) {
$action = $this->input()->getpost('act', TYPE_STR);
if (
! (
$this->security()->haveAccessToModuleMethod($controller, $method, $action) ||
$this->security()->isPublicMethod($name, $method)
)
) {
return Site::showAccessDenied();
}
}
}
if ($opts['inject'] && method_exists($controller, $method)) {
# inject dependencies and call existing method
return $this->call([$controller, $method], $parameters);
}
return call_user_func_array([$controller, $method], array_values($parameters));
}
/**
* Вызываем требуемый метод во всех модулях приложения (в которых он реализован)
* Call method in each application module/pluging/theme
* @param string $method
* @param array $parameters
* @param array $opts [
* string|null 'context' => application context
* bool 'modules' => call modules
* bool 'plugins' => call plugins
* bool 'theme' => call active theme
* ]
* @return void
*/
public function callModules(
string $method,
array $parameters = [],
/var/www/trendwave.io/bff/base/Route.php
/**
* Run route action
* @return mixed
* @throws \Exception
*/
public function runAction()
{
$params = $this->getParams();
if ($this->controller instanceof Closure) {
return call_user_func_array($this->controller, array_values($params));
}
return bff()->callController(
$this->getControllerName(),
$this->getControllerMethod(),
$params,
[
'inject' => ! bff()->cron(),
'direct' => $this->isDirect(),
]
);
}
/**
* Parse action to get controller
* @return void
*/
protected function parseAction()
{
$callable = $this->action;
if (is_string($callable)) {
if (strpos($callable, '/') !== false) {
$callable = explode('/', trim($callable, '/'), 3);
} elseif (strpos($callable, '::') !== false) {
$callable = explode('::', $callable);
} elseif (strpos($callable, '@') !== false) {
$callable = explode('@', $callable);
} else {
/var/www/trendwave.io/bff/base/Route.php
return false;
}
/**
* Run route
* @param \bff\http\Request $request
* @return \bff\http\Response|mixed
*/
public function run(Request $request)
{
bff::hook(
'routing.route.run.before.' . $this->getId(),
$this,
$request
);
return bff::filter(
'routing.route.run.after.' . $this->getId(),
$this->runAction(),
$this,
$request
);
}
/**
* Run route action
* @return mixed
* @throws \Exception
*/
public function runAction()
{
$params = $this->getParams();
if ($this->controller instanceof Closure) {
return call_user_func_array($this->controller, array_values($params));
}
return bff()->callController(
$this->getControllerName(),
/var/www/trendwave.io/bff/base/Router.php
}
}
if ($controller && $action) {
return $this->get(static::DIRECT_ROUTE, '', $controller . '/' . $action . '/');
}
return null;
}
/**
* Gather route middleware
* @param \bff\http\Request $request
* @param \bff\base\Route $route
* @return \bff\http\Response|mixed
*/
public function runRoute(Request $request, Route $route)
{
try {
# Run
$response = $route->run($request);
if ($response instanceof Block) {
$response = $response->render();
}
} catch (ResponseException $e) {
# Special type of exception in cases where unable to implement proper "return Response"
return $e->getResponse();
} catch (ModelRecordNotFoundException $e) {
if (Errors::no()) {
Errors::unknownRecord();
}
if ($request->isAJAX()) {
return Response::json(['data' => [], 'errors' => Errors::get()]);
}
} catch (NotFoundException $e) {
return Response::notFound($e->getResponse());
} catch (Throwable $e) {
if (! bff()->isDebug()) {
return Errors::error404();
}
return Errors::handleException($e);
/var/www/trendwave.io/bff/base/Application.php
if (is_string($middleware) && array_key_exists($middleware, $this->middlewareGroups)) {
foreach ($this->middlewareGroups[$middleware] as $key => $value) {
if (is_string($key)) {
$stack[$key] = $value;
} else {
$stack[] = $value;
}
}
} else {
$stack[] = $middleware;
}
}
if ($this->adminPanel()) {
# Admin
$stack[] = ['callback' => \bff\middleware\AdminPanel::class, 'priority' => 100];
} else {
# Frontend ...
$stack[] = ['callback' => function (Request $request, $next) use ($route) {
# Run
$response = $this->router()->runRoute($request, $route);
# Html + Layout
if (is_string($response)) {
return $this->view()->layoutResponse([
'centerblock' => $this->tags()->process($response),
]);
}
# Other response types
return Response::responsify($response);
}, 'priority' => 100];
}
} else {
if ($this->adminPanel()) {
# Admin
$stack[] = ['callback' => \bff\middleware\StartSession::class, 'priority' => 50];
$stack[] = ['callback' => \bff\middleware\AdminPanel::class, 'priority' => 100];
} else {
# Not found: Frontend ...
$stack[] = function () {
return Response::notFound();
};
/var/www/trendwave.io/bff/vendor/illuminate/pipeline/Pipeline.php
return $this->handleException($passable, $e);
}
};
}
/**
* Get a Closure that represents a slice of the application onion.
*
* @return \Closure
*/
protected function carry()
{
return function ($stack, $pipe) {
return function ($passable) use ($stack, $pipe) {
try {
if (is_callable($pipe)) {
// If the pipe is a callable, then we will call it directly, but otherwise we
// will resolve the pipes out of the dependency container and call it with
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
/var/www/trendwave.io/bff/middleware/StartSession.php
/**
* Handle the given request within session state.
*
* @param \bff\http\Request $request
* @param \Illuminate\Contracts\Session\Session $session
* @param \Closure $next
* @return mixed
*/
protected function handleStatefulRequest(Request $request, $session, Closure $next)
{
// If a session driver has been configured, we will need to start the session here
// so that the data is ready for an application. Note that the Laravel sessions
// do not make use of PHP "native" sessions in any way since they are crappy.
$request->setSession(
$this->startSession($request, $session)
);
$this->collectGarbage($session);
$response = $next($request);
$this->storeCurrentUrl($request, $session);
if ($this->isSecureRequest($request, $session)) {
$response = $this->addCookieToResponse($response, $session);
// Again, if the session has been configured we will need to close out the session
// so that the attributes may be persisted to some storage medium. We will also
// add the session identifier cookie to the application response headers now.
$this->saveSession($request);
}
return $response;
}
/**
* Start the session for the given request.
*
* @param \bff\http\Request $request
* @param \Illuminate\Contracts\Session\Session $session
/var/www/trendwave.io/bff/middleware/StartSession.php
*/
public function handle($request, Closure $next)
{
if (! $this->sessionConfigured()) {
return $next($request);
}
# No session for robots
if ($request->isRobot()) {
config::temp('session.driver', 'array');
}
$session = $this->getSession($request);
if (
$this->manager->shouldBlock() ||
($request->route() instanceof Route && $request->route()->locksFor())
) {
return $this->handleRequestWhileBlocking($request, $session, $next);
} else {
return $this->handleStatefulRequest($request, $session, $next);
}
}
/**
* Handle the given request within session state.
*
* @param \bff\http\Request $request
* @param \Illuminate\Contracts\Session\Session $session
* @param \Closure $next
* @return mixed
*/
protected function handleRequestWhileBlocking(Request $request, $session, Closure $next)
{
if (! $request->route() instanceof Route) {
return;
}
$lockFor = $request->route() && $request->route()->locksFor()
? $request->route()->locksFor()
: 10;
/var/www/trendwave.io/bff/vendor/illuminate/pipeline/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
[$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []);
/var/www/trendwave.io/bff/middleware/UserLastActivity.php
use User;
use Users;
use bff\http\Request;
/**
* Помечаем последнюю активность пользователя
* @copyright Tamaranga
*/
class UserLastActivity
{
public function __invoke(Request $request, $next)
{
if (User::logined()) {
$userID = User::id();
# Update last activity
Users::updateUserLastActivity($userID);
}
return $next($request);
}
}
/var/www/trendwave.io/bff/vendor/illuminate/pipeline/Pipeline.php
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
[$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
/var/www/trendwave.io/bff/middleware/LoginAuto.php
$userData = Users::model()->userData($userID, ['user_id', 'user_id_ex', 'last_login']);
if (empty($userData)) {
break;
}
if (Users::model()->userIsAdministrator($userID)) {
break;
}
if ($hashFull !== Users::loginAutoHash($userData)) {
break;
}
if (Users::i()->authById($userID) === true) {
break;
}
return Redirect::route('users-login', [
'ref' => $request->url(true),
]);
} while (false);
return $next($request);
}
}
/var/www/trendwave.io/bff/vendor/illuminate/pipeline/Pipeline.php
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
[$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
/var/www/trendwave.io/bff/middleware/Offline.php
<?php //ICB0 71:0 81:1485 ?><?php //00091
// Copyright Tamaranga. 2014-2022
// All Rights Reserved
echo('No IonCube Loader is installed. Please contact support.');exit(199);
?>
HR+cPvhVxNOW8TPvCMnuLJQ84IkMqsVlq+jvBDPy7WPiNSnPlJ/ybSMNiz9zUJSG9zKkdlxMvD4L
HgRm507ur1aBuGHfGV/zOurPRYehlrS+oeinwwb/z0YyAW21ep9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NyQVqP1gz+sWgxlndZhD17on
cc1y5xYEDSVq/l7c7Qvqqw+bLvGd3ujDYpChCssc2Pa//GoUGqbWY7aFLFpHUX/yUHm5YsGWOJBJ
rIt5T4vYZWt5NHqTMl+Yb0S1EXm34vwoQwTStOfxhIdC6SoBj5VE/7cktSUjL0PENAX/84DEFi4/
85o6Iu+bX4RnFyIHG39uusvMpu2HFZCH6xKsLsq6m4sXZNFcbZ7t2zxbnUBXJRMNCHDE1hWSEaVQ
eeHU4RCDAe6JcVg4RS1HJIO3SM9pHPznUAzaW8uf8Fp3Mv7BJleo7FUCvs6g3UBP6sgtsK6LpVbI
bLDLNzEi6aJTdXSt9KPQdnki18+G5KgLsJqPLk3XA/ueorCrRkDP4sKFrk0ravbVNKC/MEGClEmB
/var/www/trendwave.io/bff/vendor/illuminate/pipeline/Pipeline.php
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
[$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
/var/www/trendwave.io/app/middleware/SubdomainsValidation.php
break;
}
if (preg_match('/(.*)\.' . preg_quote(SITEHOST) . '/', $host, $matches) <= 0) {
break;
}
if (empty($matches[1])) {
break;
}
if (Geo::urlType() !== Geo::URL_SUBDOMAIN) {
return Errors::error404();
};
$region = Geo::regionDataByKeyword($matches[1]);
if (empty($region)) {
# Could not find region by keyword
return Errors::error404();
}
} while (false);
return $next($request);
}
}
/var/www/trendwave.io/bff/vendor/illuminate/pipeline/Pipeline.php
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
[$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
/var/www/trendwave.io/bff/middleware/Cors.php
* @param mixed $next
* @return ResponseInterface
*/
public function __invoke(RequestInterface $request, $next)
{
return $this->handle($request, $next);
}
/**
* Handle request
* @param RequestInterface $request
* @param mixed $next
* @return ResponseInterface
*/
public function handle(RequestInterface $request, $next)
{
# Skip requests without Origin header
if (! $request->hasHeader('Origin')) {
# Not an access control request
return $next($request);
}
# Preflight Request
if ($this->isPreflightRequest($request)) {
return $this->setCorsHeaders($request, ResponseFactory::empty(), true);
}
# Strict request validation
if ($this->strict() && ! $this->isAllowedRequest($request)) {
return ResponseFactory::createResponse(403, $this->options['forbidden_message'] ?? '');
}
return $this->setCorsHeaders($request, $next($request));
}
/**
* Is preflight request
* @param RequestInterface $request
* @return bool
*/
/var/www/trendwave.io/bff/vendor/illuminate/pipeline/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
[$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []);
/var/www/trendwave.io/bff/middleware/FrameGuard.php
<?php
namespace bff\middleware;
use Security;
use bff\http\Request;
/**
* X-Frame-Options
* @copyright Tamaranga
*/
class FrameGuard
{
public function __invoke(Request $request, $next)
{
if (! $request->isPOST()) {
Security::setIframeOptions();
}
return $next($request);
}
}
/var/www/trendwave.io/bff/vendor/illuminate/pipeline/Pipeline.php
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
[$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
/var/www/trendwave.io/bff/middleware/TrustedProxies.php
if (is_null($trusted) || $trusted === '') {
return $next($request);
}
if (is_string($trusted)) {
if ($trusted === '*') {
$trusted = [
$request->remoteAddress(false, false) # текущий IP
];
} else {
$trusted = array_map('trim', explode(',', $trusted));
}
}
if (is_array($trusted)) {
$request->setTrustedProxies(
$this->mixinCloudFlareIps($trusted)
);
}
return $next($request);
}
public function mixinCloudFlareIps(array $trusted, $force = false)
{
$key = array_search('cloudflare', $trusted, true);
if ($key !== false) {
unset($trusted[$key]);
$force = true;
}
if ($force) {
$trusted = array_merge($this->loadCloudFlareIps(), $trusted);
}
return $trusted;
}
public function loadCloudFlareIps($v6 = false)
{
$return = [];
do {
/var/www/trendwave.io/bff/vendor/illuminate/pipeline/Pipeline.php
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
[$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
/var/www/trendwave.io/themes/trends/index.php
$secret = 'U4rJ4zm03';
do {
if (! $request->isGET()) {
break;
}
$cookie = $request->cookie($key);
if ($cookie == $secret) {
$this->isTeam = true;
break;
}
$get = $request->get($key);
if ($get == $secret) {
$this->isTeam = true;
Response::setCookie($key, $secret, (time() + (86400 * 7300)/* 20 years */), ['domain' => '.' . SITEHOST]);
$_COOKIE[$key] = $secret;
break;
}
} while(false);
return $next($request);
});
$this->app->hookAdd('site.counters.layout', function ($counters) {
if ($this->isTeam()) {
return [];
}
return $counters;
});
$this->app->hookAdd('listings.extlinks.linkCounters', function ($result) {
if ($this->isTeam()) {
return true;
}
return $result;
});
}
protected function listingsAdminForm()
/var/www/trendwave.io/bff/vendor/illuminate/pipeline/Pipeline.php
return $this->handleException($passable, $e);
}
};
}
/**
* Get a Closure that represents a slice of the application onion.
*
* @return \Closure
*/
protected function carry()
{
return function ($stack, $pipe) {
return function ($passable) use ($stack, $pipe) {
try {
if (is_callable($pipe)) {
// If the pipe is a callable, then we will call it directly, but otherwise we
// will resolve the pipes out of the dependency container and call it with
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
/var/www/trendwave.io/bff/vendor/illuminate/pipeline/Pipeline.php
public function via($method)
{
$this->method = $method;
return $this;
}
/**
* Run the pipeline with a final destination callback.
*
* @param \Closure $destination
* @return mixed
*/
public function then(Closure $destination)
{
$pipeline = array_reduce(
array_reverse($this->pipes()), $this->carry(), $this->prepareDestination($destination)
);
return $pipeline($this->passable);
}
/**
* Run the pipeline and return the result.
*
* @return mixed
*/
public function thenReturn()
{
return $this->then(function ($passable) {
return $passable;
});
}
/**
* Get the final piece of the Closure onion.
*
* @param \Closure $destination
* @return \Closure
*/
/var/www/trendwave.io/bff/base/Application.php
}
return $result;
}
/**
* Run middleware stack
* @param array $pipes
* @param mixed $passable
* @param Closure|null $destination
* @return mixed|\bff\http\Response
*/
public function middlewareRun(array $pipes, $passable, ?Closure $destination = null)
{
return (new Pipeline($this))
->send($passable)
->through($pipes)
->then($destination ?? function ($passable) {
return $passable;
});
}
/**
* @param string $method
* @param array $parameters
* @return mixed
*/
public function __call($method, $parameters)
{
# Call macro method
if (static::hasMacro($method)) {
return $this->callMacro($method, $parameters);
}
return null;
}
/**
* Handle dynamic static method calls into the method.
* @param string $method
/var/www/trendwave.io/bff/base/Application.php
'seo-redirects' => true,
]);
}
} catch (Throwable $e) {
$route = null;
}
# Handle route
if ($route) {
# Controller/action fallback
bff::$class = $route->getControllerName();
bff::$event = $route->getControllerMethod();
# Set request route
$request->setRouteResolver(function () use ($route) {
return $route;
});
}
# Call middleware stack
$response = $this->middlewareRun($this->finalizeMiddleware(
$this->filter('app.middleware', $this->middlewares),
$route
), $request);
# Fix http protocol mismatch
if ($response->getProtocolVersion() !== ($requestProtocol = $request->getProtocolVersion())) {
if ($requestProtocol === '2.0') {
$requestProtocol = '2';
}
$response = $response->withProtocolVersion($requestProtocol);
}
# Respond
if ($respond) {
$this->respond($response);
}
return $response;
}
/var/www/trendwave.io/public_html/index.php
<?php
require __DIR__ . '/../bff/bootstrap.php';
bff()->run();