Ersetze die Zertifikats-infos bim Update
Bernd Wurst

Bernd Wurst commited on 2013-01-28 15:25:40
Zeige 1 geänderte Dateien mit 3 Einfügungen und 1 Löschungen.

... ...
@@ -204,6 +204,8 @@ function refresh_cert($id, $info, $cert, $key = NULL)
204 204
   $id = (int) $id;
205 205
   $oldcert = cert_details($id);
206 206
   $cert = mysql_real_escape_string($cert);
207
+  $subject = mysql_real_escape_string(filter_input_general($info['subject']));
208
+  $cn = mysql_real_escape_string(filter_input_general($info['cn']));
207 209
   
208 210
   $valid_from = mysql_real_escape_string($info['valid_from']);
209 211
   $valid_until = mysql_real_escape_string($info['valid_until']);
... ...
@@ -213,7 +215,7 @@ function refresh_cert($id, $info, $cert, $key = NULL)
213 215
     openssl_pkey_export($key, $key);
214 216
     $keyop = ", `key`='".mysql_real_escape_string($key)."'";
215 217
   }
216
-  db_query("UPDATE vhosts.certs SET cert='{$cert}'{$keyop}, valid_from='{$valid_from}', valid_until='{$valid_until}', chain={$chain} WHERE id={$id} LIMIT 1");
218
+  db_query("UPDATE vhosts.certs SET subject='{$subject}', cn='{$cn}', cert='{$cert}'{$keyop}, valid_from='{$valid_from}', valid_until='{$valid_until}', chain={$chain} WHERE id={$id} LIMIT 1");
217 219
 }
218 220
 
219 221
 
220 222