Skip to content
Snippets Groups Projects
Commit 56a3c120 authored by Jan Grewe's avatar Jan Grewe
Browse files

fix check for query strings

add .htaccess for Apache
parent 3d7f1ec6
Branches
No related tags found
No related merge requests found
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
...@@ -652,6 +652,7 @@ $origin_domain = strtolower( $exploded[1] ); ...@@ -652,6 +652,7 @@ $origin_domain = strtolower( $exploded[1] );
$origin_domain_exception = array_key_exists( $origin_domain, $origin_domain_exceptions ) ? $origin_domain_exceptions[$origin_domain] : 0; $origin_domain_exception = array_key_exists( $origin_domain, $origin_domain_exceptions ) ? $origin_domain_exceptions[$origin_domain] : 0;
$scheme = 'http' . ( array_key_exists( 'ssl', $_GET ) ? 's' : '' ) . '://'; $scheme = 'http' . ( array_key_exists( 'ssl', $_GET ) ? 's' : '' ) . '://';
parse_str( ( empty( $parsed['query'] ) ? '' : $parsed['query'] ), $_GET ); parse_str( ( empty( $parsed['query'] ) ? '' : $parsed['query'] ), $_GET );
$ext = strtolower( pathinfo( $parsed['path'], PATHINFO_EXTENSION ) ); $ext = strtolower( pathinfo( $parsed['path'], PATHINFO_EXTENSION ) );
...@@ -663,10 +664,10 @@ $url = $scheme . substr( $parsed['path'], 1 ); ...@@ -663,10 +664,10 @@ $url = $scheme . substr( $parsed['path'], 1 );
$url = preg_replace( '/#.*$/', '', $url ); $url = preg_replace( '/#.*$/', '', $url );
$url = apply_filters( 'url', $url ); $url = apply_filters( 'url', $url );
if ( isset( $_GET['q'] ) ) { if ( isset( $parsed['query'] ) ) {
if ( $origin_domain_exception & PHOTON__ALLOW_QUERY_STRINGS ) { if ( $origin_domain_exception & PHOTON__ALLOW_QUERY_STRINGS ) {
$url .= '?' . preg_replace( '/#.*$/', '', (string) $_GET['q'] ); $url .= '?' . preg_replace( '/#.*$/', '', (string) $parsed['query'] );
unset( $_GET['q'] ); unset( $parsed['query'] );
} else { } else {
httpdie( '400 Bad Request', "Sorry, the parameters you provided were not valid" ); httpdie( '400 Bad Request', "Sorry, the parameters you provided were not valid" );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment