Version 4.7.6

This commit is contained in:
Neo committed 2025-12-19 16:05:19 -08:00
1 parent 8ba7d43898
commit 7b7404e741
1085 files changed
+30590 -7837

No files matched your search

+30 -2
View File
@@ -597,11 +597,11 @@ class _Url
$requestObj = new \IPS\Http\Request\Curl( $this, $timeout, $httpVersion, $followRedirects, $allowedProtocols );
}
}
/* Fallback to Sockets if we can't use cURL */
if( !isset( $requestObj ) )
{
$requestObj = new \IPS\Http\Request\Sockets( $this, $timeout, $httpVersion, $followRedirects, $allowedProtocols );
$requestObj = new \IPS\Http\Request\Sockets($this, $timeout, $httpVersion, $followRedirects, $allowedProtocols);
}
/* Set a default user-agent (some services, e.g. spotify, block requests without one but it's good to do so anyway) */
@@ -1280,4 +1280,32 @@ class _Url
{
return \IPS\Http\Url\Friendly::seoTitle( $value );
}
/**
* Return a partial query string based on any filters or sort options
*
* @param array $additionalParams
* @return self
*/
public function getSafeUrlFromFilters( array $additionalParams = [] ): self
{
$extraUrlParams = [];
foreach( array_merge( ['filter', 'sortby', 'sortdirection'], $additionalParams ) as $param )
{
if ( isset( \IPS\Request::i()->$param ) )
{
$extraUrlParams[ $param ] = \IPS\Request::i()->$param;
}
}
if ( \count( $extraUrlParams ) )
{
return $this->setQueryString( $extraUrlParams );
}
else
{
return $this;
}
}
}