mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Bug fix (regression): use a different endpoint (ajax.document.render.php) for the output of the JS dictionary since we use the JS dictionary also when there is no user logged in (like in the login page).
SVN:trunk[5691]
This commit is contained in:
@@ -824,7 +824,7 @@ class WebPage implements Page
|
||||
file_put_contents($sJSFileName, $this->get_dict_file_content());
|
||||
}
|
||||
// Load the dictionary as the first javascript file, so that other JS file benefit from the translations
|
||||
array_unshift($this->a_linked_scripts, utils::GetAbsoluteUrlAppRoot().'pages/ajax.render.php/?operation=dict&s='.$sSignature);
|
||||
array_unshift($this->a_linked_scripts, utils::GetAbsoluteUrlAppRoot().'pages/ajax.document.php?operation=dict&s='.$sSignature);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,6 +95,15 @@ try
|
||||
}
|
||||
break;
|
||||
|
||||
case 'dict':
|
||||
$sSignature = Utils::ReadParam('s', ''); // Sanitization prevents / and ..
|
||||
$oPage = new ajax_page(""); // New page to cleanup the no_cache done above
|
||||
$oPage->SetContentType('text/javascript');
|
||||
$oPage->add_header('Cache-control: public, max-age=86400'); // Cache for 24 hours
|
||||
$oPage->add_header("Pragma: cache"); // Reset the value set .... where ?
|
||||
$oPage->add(file_get_contents(Utils::GetCachePath().$sSignature.'.js'));
|
||||
break;
|
||||
|
||||
default:
|
||||
$oPage->p("Invalid query.");
|
||||
}
|
||||
|
||||
@@ -2581,15 +2581,6 @@ EOF
|
||||
$oPage->add(json_encode($aResult));
|
||||
break;
|
||||
|
||||
case 'dict':
|
||||
$sSignature = Utils::ReadParam('s', ''); // Sanitization prevents / and ..
|
||||
$oPage = new ajax_page(""); // New page to cleanup the no_cache done above
|
||||
$oPage->SetContentType('text/javascript');
|
||||
$oPage->add_header('Cache-control: public, max-age=86400'); // Cache for 24 hours
|
||||
$oPage->add_header("Pragma: cache"); // Reset the value set .... where ?
|
||||
$oPage->add(file_get_contents(Utils::GetCachePath().$sSignature.'.js'));
|
||||
break;
|
||||
|
||||
default:
|
||||
$oPage->p("Invalid query.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user