mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-04 07:47:34 +02:00
Merge pull request #904 from igorw/ticket/11008
[PHPBB3-11008] Get rid of eval in javascript
This commit is contained in:
@@ -62,11 +62,7 @@ function dE(n, s, type)
|
||||
*/
|
||||
function marklist(id, name, state)
|
||||
{
|
||||
var parent = document.getElementById(id);
|
||||
if (!parent)
|
||||
{
|
||||
eval('parent = document.' + id);
|
||||
}
|
||||
var parent = document.getElementById(id) || document[id];
|
||||
|
||||
if (!parent)
|
||||
{
|
||||
|
@@ -42,11 +42,7 @@ function jumpto()
|
||||
*/
|
||||
function marklist(id, name, state)
|
||||
{
|
||||
var parent = document.getElementById(id);
|
||||
if (!parent)
|
||||
{
|
||||
eval('parent = document.' + id);
|
||||
}
|
||||
var parent = document.getElementById(id) || document[id];
|
||||
|
||||
if (!parent)
|
||||
{
|
||||
|
@@ -2,7 +2,9 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
onload_functions.push('document.getElementById("<!-- IF S_ADMIN_AUTH -->{PASSWORD_CREDENTIAL}<!-- ELSE -->{USERNAME_CREDENTIAL}<!-- ENDIF -->").focus();');
|
||||
onload_functions.push(function () {
|
||||
document.getElementById("<!-- IF S_ADMIN_AUTH -->{PASSWORD_CREDENTIAL}<!-- ELSE -->{USERNAME_CREDENTIAL}<!-- ENDIF -->").focus();
|
||||
});
|
||||
// ]]>
|
||||
</script>
|
||||
|
||||
|
@@ -56,7 +56,7 @@
|
||||
{
|
||||
for (var i = 0; i < onload_functions.length; i++)
|
||||
{
|
||||
eval(onload_functions[i]);
|
||||
onload_functions[i]();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
{
|
||||
for (var i = 0; i < onunload_functions.length; i++)
|
||||
{
|
||||
eval(onunload_functions[i]);
|
||||
onunload_functions[i]();
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
onload_functions.push('apply_onkeypress_event()');
|
||||
onload_functions.push(apply_onkeypress_event);
|
||||
// ]]>
|
||||
</script>
|
||||
|
||||
|
@@ -2,7 +2,9 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
onload_functions.push('document.getElementById("keywords").focus();');
|
||||
onload_functions.push(function () {
|
||||
document.getElementById("keywords").focus();
|
||||
});
|
||||
// ]]>
|
||||
</script>
|
||||
|
||||
|
@@ -26,7 +26,7 @@
|
||||
{
|
||||
for (var i = 0; i < onload_functions.length; i++)
|
||||
{
|
||||
eval(onload_functions[i]);
|
||||
onload_functions[i]();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
{
|
||||
for (var i = 0; i < onunload_functions.length; i++)
|
||||
{
|
||||
eval(onunload_functions[i]);
|
||||
onunload_functions[i]();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -12,7 +12,7 @@
|
||||
}
|
||||
|
||||
<!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_REFRESH -->
|
||||
onload_functions.push('apply_onkeypress_event()');
|
||||
onload_functions.push(apply_onkeypress_event);
|
||||
<!-- ENDIF -->
|
||||
|
||||
// ]]>
|
||||
|
@@ -43,11 +43,7 @@
|
||||
*/
|
||||
function marklist(id, name, state)
|
||||
{
|
||||
var parent = document.getElementById(id);
|
||||
if (!parent)
|
||||
{
|
||||
eval('parent = document.' + id);
|
||||
}
|
||||
var parent = document.getElementById(id) || document[id];
|
||||
|
||||
if (!parent)
|
||||
{
|
||||
|
@@ -71,11 +71,7 @@ function find_username(url)
|
||||
*/
|
||||
function marklist(id, name, state)
|
||||
{
|
||||
var parent = document.getElementById(id);
|
||||
if (!parent)
|
||||
{
|
||||
eval('parent = document.' + id);
|
||||
}
|
||||
var parent = document.getElementById(id) || document[id];
|
||||
|
||||
if (!parent)
|
||||
{
|
||||
|
Reference in New Issue
Block a user