fixed order of achievement title and count
This commit is contained in:
commit
df3dd6466c
3459 changed files with 594367 additions and 0 deletions
39
www/analytics/core/Translate/Validate/NoScripts.php
Normal file
39
www/analytics/core/Translate/Validate/NoScripts.php
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
/**
|
||||
* Piwik - Open source web analytics
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Piwik\Translate\Validate;
|
||||
|
||||
/**
|
||||
*/
|
||||
class NoScripts extends ValidateAbstract
|
||||
{
|
||||
/**
|
||||
* Validates the given translations
|
||||
* * No script like parts should be present in any part of the translations
|
||||
*
|
||||
* @param array $translations
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($translations)
|
||||
{
|
||||
$this->message = null;
|
||||
|
||||
// check if any translation contains restricted script tags
|
||||
$serializedStrings = serialize($translations);
|
||||
$invalids = array("<script", 'document.', 'javascript:', 'src=', 'background=', 'onload=');
|
||||
foreach ($invalids as $invalid) {
|
||||
if (stripos($serializedStrings, $invalid) !== false) {
|
||||
$this->message = 'script tags restricted for language files';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue