Bug #7926: Make sure we decode before re-encoding.
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 5 Feb 2009 21:10:48 +0000 (14:10 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 6 Feb 2009 05:16:47 +0000 (22:16 -0700)
imp/pgp.php
imp/smime.php

index a65ec9a..ce20f9e 100644 (file)
@@ -116,7 +116,7 @@ case 'process_import_public_key':
             foreach ($key_info['signature'] as $sig) {
                 $notification->push(sprintf(_("PGP Public Key for \"%s (%s)\" was successfully added."), $sig['name'], $sig['email']), 'horde.success');
             }
-            Util::closeWindowJS('opener.focus();opener.location.href="' . htmlspecialchars(Util::getFormData('reload')) . '";');
+            Util::closeWindowJS('opener.focus();opener.location.href="' . htmlspecialchars(html_entity_decode(Util::getFormData('reload'))) . '";');
         }
     }
     exit;
@@ -166,7 +166,7 @@ case 'process_import_personal_private_key':
              * successfully - close the import popup window. */
             $imp_pgp->addPersonalPrivateKey($privateKey);
             $notification->push(_("PGP private key successfully added."), 'horde.success');
-            Util::closeWindowJS('opener.focus();opener.location.href="' . htmlspecialchars(Util::getFormData('reload')) . '";');
+            Util::closeWindowJS('opener.focus();opener.location.href="' . htmlspecialchars(html_entity_decode(Util::getFormData('reload'))) . '";');
         } else {
             /* Invalid private key imported - Redo private key import
              * screen. */
index 73e057a..26f1ec2 100644 (file)
@@ -20,7 +20,7 @@ function _importKeyDialog($target)
     $t->setOption('gettext', true);
     $t->set('selfurl', Horde::applicationUrl('smime.php'));
     $t->set('broken_mp_form', $GLOBALS['browser']->hasQuirk('broken_multipart_form'));
-    $t->set('reload', htmlspecialchars(Util::getFormData('reload')));
+    $t->set('reload', htmlspecialchars(html_entity_decode(Util::getFormData('reload'))));
     $t->set('target', $target);
     $t->set('forminput', Util::formInput());
     $t->set('import_public_key', $target == 'process_import_public_key');
@@ -54,7 +54,7 @@ function _actionWindow()
 
 function _reloadWindow()
 {
-    Util::closeWindowJS('opener.focus();opener.location.href="' . htmlspecialchars(Util::getFormData('reload')) . '";');
+    Util::closeWindowJS('opener.focus();opener.location.href="' . htmlspecialchars(html_entity_decode(Util::getFormData('reload'))) . '";');
 }
 
 function _textWindowOutput($filename, $msg, $html = false)