diff options
author | Igor Wiedler <igor@wiedler.ch> | 2012-07-20 23:59:04 +0200 |
---|---|---|
committer | Igor Wiedler <igor@wiedler.ch> | 2012-07-21 00:12:45 +0200 |
commit | 61f7f1b8edf5cf0efb1b33495e2069a151d6baa9 (patch) | |
tree | 029791f5c6c84f1fed6a24c220840f7bc4346740 | |
parent | ca43a8947a67642f6d1f211f1f5e030b2526ebe2 (diff) | |
download | forums-61f7f1b8edf5cf0efb1b33495e2069a151d6baa9.tar forums-61f7f1b8edf5cf0efb1b33495e2069a151d6baa9.tar.gz forums-61f7f1b8edf5cf0efb1b33495e2069a151d6baa9.tar.bz2 forums-61f7f1b8edf5cf0efb1b33495e2069a151d6baa9.tar.xz forums-61f7f1b8edf5cf0efb1b33495e2069a151d6baa9.zip |
[ticket/11008] Change onunload_functions to not use eval()
PHPBB3-11008
6 files changed, 12 insertions, 8 deletions
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 --> // ]]> |