aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2012-07-20 15:16:07 -0700
committerNils Adermann <naderman@naderman.de>2012-07-20 15:16:07 -0700
commitb3212bd7f9bd8b819dd6bc9741a319cdfccf24d2 (patch)
tree029791f5c6c84f1fed6a24c220840f7bc4346740
parent841ea0e494504400c798faa6cc860dd1179e1004 (diff)
parent61f7f1b8edf5cf0efb1b33495e2069a151d6baa9 (diff)
downloadforums-b3212bd7f9bd8b819dd6bc9741a319cdfccf24d2.tar
forums-b3212bd7f9bd8b819dd6bc9741a319cdfccf24d2.tar.gz
forums-b3212bd7f9bd8b819dd6bc9741a319cdfccf24d2.tar.bz2
forums-b3212bd7f9bd8b819dd6bc9741a319cdfccf24d2.tar.xz
forums-b3212bd7f9bd8b819dd6bc9741a319cdfccf24d2.zip
Merge pull request #904 from igorw/ticket/11008
[PHPBB3-11008] Get rid of eval in javascript
-rw-r--r--phpBB/adm/style/overall_header.html6
-rw-r--r--phpBB/styles/prosilver/template/forum_fn.js6
-rw-r--r--phpBB/styles/prosilver/template/login_body.html4
-rw-r--r--phpBB/styles/prosilver/template/overall_header.html4
-rw-r--r--phpBB/styles/prosilver/template/posting_editor.html2
-rw-r--r--phpBB/styles/prosilver/template/search_body.html4
-rw-r--r--phpBB/styles/prosilver/template/simple_header.html4
-rw-r--r--phpBB/styles/prosilver/template/ucp_register.html2
-rw-r--r--phpBB/styles/subsilver2/template/memberlist_search.html6
-rw-r--r--phpBB/styles/subsilver2/template/overall_header.html6
10 files changed, 16 insertions, 28 deletions
diff --git a/phpBB/adm/style/overall_header.html b/phpBB/adm/style/overall_header.html
index f79c0318b5..f6d0e1025f 100644
--- a/phpBB/adm/style/overall_header.html
+++ b/phpBB/adm/style/overall_header.html
@@ -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)
{
diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js
index 240fe7e51d..995b4b0ab7 100644
--- a/phpBB/styles/prosilver/template/forum_fn.js
+++ b/phpBB/styles/prosilver/template/forum_fn.js
@@ -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)
{
diff --git a/phpBB/styles/prosilver/template/login_body.html b/phpBB/styles/prosilver/template/login_body.html
index d8b9b01779..90d8191676 100644
--- a/phpBB/styles/prosilver/template/login_body.html
+++ b/phpBB/styles/prosilver/template/login_body.html
@@ -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>
diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html
index 349309ab4e..43ae83767d 100644
--- a/phpBB/styles/prosilver/template/overall_header.html
+++ b/phpBB/styles/prosilver/template/overall_header.html
@@ -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]();
}
};
diff --git a/phpBB/styles/prosilver/template/posting_editor.html b/phpBB/styles/prosilver/template/posting_editor.html
index d1c86e7e13..99e518d486 100644
--- a/phpBB/styles/prosilver/template/posting_editor.html
+++ b/phpBB/styles/prosilver/template/posting_editor.html
@@ -1,6 +1,6 @@
<script type="text/javascript">
// <![CDATA[
- onload_functions.push('apply_onkeypress_event()');
+ onload_functions.push(apply_onkeypress_event);
// ]]>
</script>
diff --git a/phpBB/styles/prosilver/template/search_body.html b/phpBB/styles/prosilver/template/search_body.html
index a8baafa5f1..0d8797b2ff 100644
--- a/phpBB/styles/prosilver/template/search_body.html
+++ b/phpBB/styles/prosilver/template/search_body.html
@@ -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>
diff --git a/phpBB/styles/prosilver/template/simple_header.html b/phpBB/styles/prosilver/template/simple_header.html
index 5440d66520..6026dfd329 100644
--- a/phpBB/styles/prosilver/template/simple_header.html
+++ b/phpBB/styles/prosilver/template/simple_header.html
@@ -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]();
}
}
diff --git a/phpBB/styles/prosilver/template/ucp_register.html b/phpBB/styles/prosilver/template/ucp_register.html
index 994356efe6..e14ca6493d 100644
--- a/phpBB/styles/prosilver/template/ucp_register.html
+++ b/phpBB/styles/prosilver/template/ucp_register.html
@@ -12,7 +12,7 @@
}
<!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_REFRESH -->
- onload_functions.push('apply_onkeypress_event()');
+ onload_functions.push(apply_onkeypress_event);
<!-- ENDIF -->
// ]]>
diff --git a/phpBB/styles/subsilver2/template/memberlist_search.html b/phpBB/styles/subsilver2/template/memberlist_search.html
index 96ffad00d6..ab1ecca2ee 100644
--- a/phpBB/styles/subsilver2/template/memberlist_search.html
+++ b/phpBB/styles/subsilver2/template/memberlist_search.html
@@ -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)
{
diff --git a/phpBB/styles/subsilver2/template/overall_header.html b/phpBB/styles/subsilver2/template/overall_header.html
index 5d5489338a..f08531c47f 100644
--- a/phpBB/styles/subsilver2/template/overall_header.html
+++ b/phpBB/styles/subsilver2/template/overall_header.html
@@ -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)
{