| @@ -107,10 +107,10 @@ | ||
| 107 | 107 | $template->fill(); |
| 108 | 108 | $request = $template->render(); |
| 109 | 109 | |
| 110 | 110 | if (!isset($request['error'])) { |
| 111 | - | |
| 112 | - $tmp_dir = $this->helper->get('tmp_dir') . 'e2pdf' . md5($entry->get('uid')) . '/'; | |
| 111 | + $attach = $attributes->get('attach') === 'always' ? '_' . bin2hex(random_bytes(8)) : ''; | |
| 112 | + $tmp_dir = $this->helper->get('tmp_dir') . 'e2pdf' . md5($entry->get('uid') . $attach) . '/'; | |
| 113 | 113 | $this->helper->create_dir($tmp_dir); |
| 114 | 114 | |
| 115 | 115 | $filename = $template->get('name') . '.' . $template->get('format'); |
| 116 | 116 | $filename = $this->helper->load('convert')->to_file_name($filename); |
| @@ -153,9 +153,9 @@ | ||
| 153 | 153 | */ |
| 154 | 154 | if (strpos($attributes->get('dataset'), 'post_data:ID') !== false) { |
| 155 | 155 | $response .= '[e2pdf-download '; |
| 156 | 156 | foreach ($atts as $key => $value) { |
| 157 | - $response .= $key . '="' . str_replace('"', '', $value) . '" '; | |
| 157 | + $response .= sanitize_key($key) . '="' . esc_attr($value) . '" '; | |
| 158 | 158 | } |
| 159 | 159 | $response .= ']'; |
| 160 | 160 | return $response; |
| 161 | 161 | } |