summaryrefslogtreecommitdiff
path: root/includes/functions/functions_print.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2013-12-09 08:54:41 +0000
committerGreg Roach <fisharebest@gmail.com>2013-12-09 08:54:41 +0000
commitb9e3cf0e805235d6f0363467e3793a7ff4222e7d (patch)
tree201fb9abc6ad61c3a9df2fc7e10d21d8ade54def /includes/functions/functions_print.php
parent1aa3384efdee4d99be5a3dd2117cd0800a7938f1 (diff)
downloadwebtrees-b9e3cf0e805235d6f0363467e3793a7ff4222e7d.tar.gz
webtrees-b9e3cf0e805235d6f0363467e3793a7ff4222e7d.tar.bz2
webtrees-b9e3cf0e805235d6f0363467e3793a7ff4222e7d.zip
Fix: copy/paste facts not working with CSRF checks
Diffstat (limited to 'includes/functions/functions_print.php')
-rw-r--r--includes/functions/functions_print.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/includes/functions/functions_print.php b/includes/functions/functions_print.php
index b3e6c74ed1..176da44824 100644
--- a/includes/functions/functions_print.php
+++ b/includes/functions/functions_print.php
@@ -920,17 +920,16 @@ function print_add_new_fact($id, $usedfacts, $type) {
// -- Add from clipboard
if ($WT_SESSION->clipboard) {
$newRow = true;
- foreach (array_reverse($WT_SESSION->clipboard, true) as $key=>$fact) {
+ foreach (array_reverse($WT_SESSION->clipboard, true) as $fact_id=>$fact) {
if ($fact["type"]==$type || $fact["type"]=='all') {
if ($newRow) {
$newRow = false;
echo '<tr><td class="descriptionbox">';
echo WT_I18N::translate('Add from clipboard'), '</td>';
echo '<td class="optionbox wrap"><form method="get" name="newFromClipboard" action="?" onsubmit="return false;">';
- echo '<select id="newClipboardFact" name="newClipboardFact">';
+ echo '<select id="newClipboardFact">';
}
- $fact_type=WT_Gedcom_Tag::getLabel($fact['fact']);
- echo '<option value="clipboard_', $key, '">', $fact_type;
+ echo '<option value="', WT_Filter::escapeHtml($fact_id), '">', WT_Gedcom_Tag::getLabel($fact['fact']);
// TODO use the event class to store/parse the clipboard events
if (preg_match('/^2 DATE (.+)/m', $fact['factrec'], $match)) {
$tmp=new WT_Date($match[1]);
@@ -944,7 +943,7 @@ function print_add_new_fact($id, $usedfacts, $type) {
}
if (!$newRow) {
echo '</select>';
- echo '&nbsp;&nbsp;<input type="button" value="', WT_I18N::translate('Add'), "\" onclick=\"addClipboardRecord('$id', 'newClipboardFact');\"> ";
+ echo '&nbsp;&nbsp;<input type="button" value="', WT_I18N::translate('Add'), "\" onclick=\"return paste_fact('$id', '#newClipboardFact');\"> ";
echo '</form></td></tr>', "\n";
}
}