summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiam Morland2012-12-10 21:34:27 (GMT)
committer Kevin Kaland2012-12-10 21:34:27 (GMT)
commit06cd92a696dd93433f9f7b2ec6f6b33a8c60c9c8 (patch)
tree91206700e05efed2eaa6ad50727678e3fd34cd81
parent6d640b33d41da306514c26a978edbe530fa7f01e (diff)
Issue #1830168: Allow slashes in PDF key.
-rw-r--r--fillpdf.admin.inc5
1 files changed, 4 insertions, 1 deletions
diff --git a/fillpdf.admin.inc b/fillpdf.admin.inc
index 1a3a274..da2ea0e 100644
--- a/fillpdf.admin.inc
+++ b/fillpdf.admin.inc
@@ -373,7 +373,9 @@ function fillpdf_form_edit($form, &$form_state, $fid) {
check_plain($field->pdf_key),
$field->value, // editable, expandable
($field->replacements ? 'Yes' : 'No'),
- l(t('Edit'), "admin/structure/fillpdf/$fid/edit/{$field->pdf_key}"),
+ // rawurlencode() is needed twice to fully protect "/". Otherwise, "/" is
+ // taken as a separator when looking for a match in hook_menu().
+ l(t('Edit'), "admin/structure/fillpdf/$fid/edit/" . rawurlencode(rawurlencode($field->pdf_key))),
);
$rows[] = $row;
}
@@ -638,6 +640,7 @@ function fillpdf_field($op, $fid, $pdf_key = NULL) {
return fillpdf_form_overview($pdf_form);
}
elseif ($pdf_key) {
+ $pdf_key = rawurldecode(rawurldecode($pdf_key));
$field = db_query("SELECT * FROM {fillpdf_fields} WHERE pdf_key = :pdf_key AND fid = :fid", array(':pdf_key' => $pdf_key, ':fid' => $fid))->fetch();
if (!$field) {
drupal_not_found();