/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 message title
* @param string|int|array $message message text or message ID (Errors)
* @param array $opts ['auth' - requires authorization]
* @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');
}
/**
* Correction of the current request URL with subsequent 301 redirect
* @param string $url correct URL
* @param array $opts parameters
* @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
6mnPqAeC9oIm9caPTj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Z4bGj5w5tOXBKcq4AADlf3kZ7BHVyIk9jj+mdAYsEQmQ+
ZGOiqGfAoLvnskFQZ/kAJXlyGvehOvuH6kEaiE95G0HCZDwX8Zhk6d/nUtRMPIeOc6eCsq23EwR/
NXUgfuxWCebnGPGC5C6OBQoF8iFHoZurbc0hoxHTtlBl4Wve8+mNpnUclJqHyS+rIi2RGmspj6Ad
hnRWCFFulekG6PlI3J+nX3GF5D9LLVaYRAXlbMV5MxcGud5Hxu77bxcaM+bXv9bjr7TZCwAK3sCJ
64jEYADMh4ZUT1rAwY5eR7LFNUZCFHkNKw673kP9B7tcBWnCPKmWwCBPMYKOvFCv7ztpKUiXqx9X
8Z2fxatiXsZGQz6uHNOwId8U/BBF+/WsNXTjSYgF7dEtNFWged0xk+AgRK5PVd1+3X5IAot/qLXZ
iCtROu4JBnOF8X0VXUxQsrum3uAv5fan48bfLFoxTrX0gnFT/N3j/HTYKQBVzHaesRh3rO4j3WZJ
DhaRMhWNJBd+m8zXwQ3mp6B/9bDehHpf2kZF61amC3FSUPKRug7qAPBTmR0fdcFm/VIYiF0penZR
D0GUDDPqH8mDZs7ZMDJBGsgonwkPhnjtPN1xsA6xswZJV2DP1ZMap/6iEbDqQ/O68fRj+YYrXOlq
4OzmwcqOz6bDUcFFZTFITuHNtZGcgJBbWcm3y7wiOtKzi26p0pUtJcO8g5mDe4maLCfLuYJp9P7w
mEyr+k/fWjwsta4OlBfZfAzc9Q1aikNXDV/8STeC5vRf+ctqOIKndGE+F+oM8qVLXSy7mm6efsR9
ixE6z/n1BbzqSGWPaj+FGXf77VRnzS57hQ9pVzLboeWfxT/FUxeZwZkhKM8VUutEEF/JC6fj3sVj
/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 the required method in all application modules (in which it is implemented)
* 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()) {
Errors::logException($e);
return Errors::error404();
}
/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->view()->vueRender(
$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 () {
/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;
/**
* Marking the user's last activity
* @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:1434 ?><?php //00091
// Copyright Tamaranga. 2014-2022
// All Rights Reserved
echo('No IonCube Loader is installed. Please contact support.');exit(199);
?>
HR+cP/+8RnWh2R7W3DZSZGXrK0dd7zoxgZPfG+Z0/v0xV1l2ot/5kNNVQC7POQyqC2OFT8KUpN1A
Qp58z3xRYCHAZUkVSVp9KK1Qo5eTuvmqV/E4rGk5jcieqcgBAnia877Xip9fWdh7lu37a9BqWjU7
SDlclUTH5GbxUFmKY8imPv22XVctv8xmY9TvppgtUGo5qfdrUERoKClOXkCtTP/zuH4R4UBLZbUK
DpsXkQPRk1CnQB7MOuSGluHQnjT2oSOjqSqUqLEkzlEFfO7CrzEZdOnvl9/1OWZg4HUs/GMDgK55
uj+Z8FXXMn7hLOj9/4X4ZtoBn2Lz0Qk1JIxgz0HuLzlvAY67vnUCYptEtpZ5wLKh4lxDqWogu6q+
uUmRpSiosNjz4V4RvqFvvMjdM4Ebay8PRA6WSQG8K9/YEnZAZ7TpQ5hc4RkdUgLn+5dvhw4LIqHz
uMn5yi8FXmH3XYauxRkeP5eGk37pb+eVakD5iY29bkV1hqaoMWBiNtW6mxbpcWPIBRLahwL9Rpq6
DmTXsWrAOiFnrJL/fkr7A5tBa6b+xOHfSEPJTsY8cYGdfIKhgdij0DxKog4WS5hO0V9SSiSzTAFP
2vE1j7n75vcPanCJQKhkQHJ1hJ1qrq1wdK1qb+vA3CTR845Zj60qZ5xuiee8Tl8GzMoUQd4QpXoU
ee6M+6vN53b8gA/941OsTDWYITDTxro2/f/bkCW2mP46FL/29MaRs1KDvS7MYAqoGisg1iNgZ6DH
TAdJeOEcsWcYSTSAQqVUX4XgHGreqBtqJsaM8g8Ca8JS97oD2HJQ7ePBLGZO6eBILBjAX80ebrZ1
bSePfYxKsEOCxQNdC/YUtNvUD/O34pL/L2bdwLdMaFFuSDkIFgvMHEq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6nOB7+iHJ0w5VYeLQvOSCLUO
MYibyszpgszfO3Bv9V8tgx8XcRAasYEjBNb/rG6ls4Q68tJpjlMB9Zt/8CjO9kXrSVHkvZgEZOI2
SB0OsLFpM2THuHtJQ6xFWRilNiuHB9lx4f3vKEzMczzbIM5CV2XVDxztsuok/bXM7uEBkhUgO2o1
DpAQdOXZhJkZUAS3Kxuv2urD5fsRtE2+N9crDXiBbTNRLPs7k2JqXU8U8Gso9ZXrkt2bJFhBuYjo
dB8SeouBTDyoiaUl6aXSdKui9g7DYjBPd4Fp9lc+ubq1IYUpVrbkp35QgglKw1+x12ChXq4EbuEv
eh1/CAMsGeHa0Lskgrt1fbIQ3U/SMBaYLsGIFhgbsDrw+rDZ+/P9YEr/3H/z/QiSJQiC7/W/xs6u
hQIDIVqaEcVmuyiqBV/h4cztZ0Y16j6locglpuiMjT2GFcoOrzJvQyer+mjrOh8qKZ75iZJOdUsA
a0grPQHMM+eit+Qbc+gwLzwvWlf5yEmauAt1tSwxvS6AvGPRLSJM3SCVf/24pMwPHQ6M/fZdTRqP
av7ijwDfYl9isAgBSKF+Kmq/+Cs6attmOJEpw1vGBpKd663ziB/FtIF2cfzFUYDg4u6W6qPHxlkc
crF/oJ967W0qRU/KA79jhNBZMZAwnSyDgVDKcr4sj+leoYzWLEOVorC9QNcd0fNSSg0SqiirtRMY
/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) // current 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();