Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Prevent duplicate content if in the url is given the wrong ?language=…

… parameter #oscommerce
  • Loading branch information...
commit 6e8dd30d8c8f21ba0d8fc5eafcbbf157a462920a 1 parent 19d7a9b
unknown authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 catalog/includes/classes/language.php
View
6 catalog/includes/classes/language.php
@@ -74,9 +74,15 @@ function set_language($language) {
if ( (tep_not_null($language)) && (isset($this->catalog_languages[$language])) ) {
$this->language = $this->catalog_languages[$language];
} else {
+ if (in_array($this->language,$this->catalog_languages)) {
+ header('HTTP/1.1 404 Not Found'); ?>
+ <h1>404 Not Found</h1>
+ <? exit;
+ }else{
$this->language = $this->catalog_languages[DEFAULT_LANGUAGE];
}
}
+ }
function get_browser_language() {
$this->browser_languages = explode(',', $_SERVER["HTTP_ACCEPT_LANGUAGE"]);
Please sign in to comment.
Something went wrong with that request. Please try again.