diff options
| -rw-r--r-- | editgedcoms.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/editgedcoms.php b/editgedcoms.php index 8d6040c175..aacdb06dd0 100644 --- a/editgedcoms.php +++ b/editgedcoms.php @@ -171,7 +171,8 @@ case 'importform': break; } echo '<p>', i18n::translate('This will delete all the genealogical data from <b>%s</b> and replace it with data from another GEDCOM.', $gedcom_name), '</p>'; - echo '<form name="replaceform" method="post" enctype="multipart/form-data" action="', WT_SCRIPT_NAME, '" onsubmit="if (document.replaceform.ged_name.value!=\'', htmlspecialchars($gedcom_name), '\') return confirm(\'', htmlspecialchars(i18n::translate('You have selected a GEDCOM with a different name. Is this correct?')), '\'); else return true;">'; + // the javascript in the next line strips any path associated with the file before comparing it to the current GEDCOM name (both Chrome and IE8 include c:\fakepath\ in the filename). + echo '<form name="replaceform" method="post" enctype="multipart/form-data" action="', WT_SCRIPT_NAME, '" onsubmit="var newfile = document.replaceform.ged_name.value; newfile = newfile.substr(newfile.lastIndexOf(\'\\\\\')+1); if (newfile!=\'', htmlspecialchars($gedcom_name), '\') return confirm(\'', htmlspecialchars(i18n::translate('You have selected a GEDCOM with a different name. Is this correct?')), '\'); else return true;">'; echo '<input type="hidden" name="gedcom_id" value="', $gedcom_id, '" />'; if (safe_GET('action')=='uploadform') { echo '<input type="hidden" name="action" value="replace_upload" />'; |
