From a52629f24214fed6acec55d7041cae35a9dfa9f5 Mon Sep 17 00:00:00 2001
From: Josef Moravec <josef.moravec@gmail.com>
Date: Wed, 24 Jun 2020 16:28:33 -0400
Subject: [PATCH] Remove event attributes from upgrade code.

---
 .../templates/upgrade/fixanonymoustags.phtml          | 11 ++++++++++-
 .../templates/upgrade/fixduplicatetags.phtml          | 11 ++++++++++-
 themes/bootstrap3/templates/upgrade/fixmetadata.phtml | 11 ++++++++++-
 3 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/themes/bootstrap3/templates/upgrade/fixanonymoustags.phtml b/themes/bootstrap3/templates/upgrade/fixanonymoustags.phtml
index 26b14cc2cef..175653e36de 100644
--- a/themes/bootstrap3/templates/upgrade/fixanonymoustags.phtml
+++ b/themes/bootstrap3/templates/upgrade/fixanonymoustags.phtml
@@ -22,5 +22,14 @@ an administrator) to associate with old anonymous tags.</p>
 
 <form method="post" action="<?=$this->url('upgrade-fixanonymoustags')?>">
   <?=$this->transEsc('Username') ?>: <input type="text" name="username" /> <input type="submit" name="submit" value="<?=$this->transEsc('Submit') ?>" /><br /><br />
-  <input type="submit" name="skip" value="<?=$this->transEsc('skip_step') ?>." onclick="return confirm('<?=$this->transEsc('skip_confirm') ?>');"/>
+  <input type="submit" name="skip" id="skip" value="<?=$this->transEsc('skip_step') ?>." />
 </form>
+<?php
+$skipText = $this->transEsc('skip_confirm');
+$script = <<<JS
+$('#skip').click(function(e) {
+    return confirm('${skipText}');
+});
+JS;
+?>
+<?=$this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, $script, 'SET');
diff --git a/themes/bootstrap3/templates/upgrade/fixduplicatetags.phtml b/themes/bootstrap3/templates/upgrade/fixduplicatetags.phtml
index e3add9f0c57..74d9cf34943 100644
--- a/themes/bootstrap3/templates/upgrade/fixduplicatetags.phtml
+++ b/themes/bootstrap3/templates/upgrade/fixduplicatetags.phtml
@@ -21,5 +21,14 @@ otherwise, it is recommended that you fix these.  Click Submit to proceed.</p>
 
 <form method="post" action="<?=$this->url('upgrade-fixduplicatetags')?>">
   <input type="submit" name="submit" value="<?=$this->transEsc('Submit') ?>" /><br /><br />
-  <input type="submit" name="skip" value="<?=$this->transEsc('skip_step') ?>." onclick="return confirm('<?=$this->transEsc('skip_confirm') ?>');"/>
+  <input type="submit" name="skip" value="<?=$this->transEsc('skip_step') ?>." id="skip" />
 </form>
+<?php
+$confirmText = $this->transEsc('skip_confirm');
+$script = <<<JS
+$('#skip').click(function(e) {
+  return confirm('${confirmText}');
+});
+JS;
+?>
+<?=$this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, $script, 'SET');
diff --git a/themes/bootstrap3/templates/upgrade/fixmetadata.phtml b/themes/bootstrap3/templates/upgrade/fixmetadata.phtml
index 4b82d414e4b..4af1d077fae 100644
--- a/themes/bootstrap3/templates/upgrade/fixmetadata.phtml
+++ b/themes/bootstrap3/templates/upgrade/fixmetadata.phtml
@@ -15,5 +15,14 @@ but it will improve the user experience by allowing proper sorting of favorites
 
 <form method="post" action="<?=$this->url('upgrade-fixmetadata')?>">
   <input type="submit" name="submit" value="<?=$this->transEsc('fix_metadata') ?>." /><br /><br />
-  <input type="submit" name="skip" value="<?=$this->transEsc('skip_fix_metadata') ?>." onclick="return confirm('<?=$this->transEsc('skip_confirm') ?>');"/>
+  <input type="submit" name="skip" value="<?=$this->transEsc('skip_fix_metadata') ?>." id="skip" />
 </form>
+<?php
+$confirmText = $this->transEsc('skip_confirm');
+$script = <<<JS
+$('#skip').click(function(e) {
+  return confirm('${confirmText}');
+});
+JS;
+?>
+<?=$this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, $script, 'SET');
-- 
GitLab