Strip WWN part from disk identifier (if present)

This commit is contained in:
bergware
2016-08-29 13:36:56 +02:00
parent b82a915e94
commit 844cf94f00
+1 -1
View File
@@ -68,7 +68,7 @@ function device_browse(&$disk) {
function device_id($id) {
$len = strlen($id);
$wwn = substr($id,-18);
return (substr($wwn,0,2)!='_3' || preg_match('/.(_|-)/',$wwn)) ? $id : substr($id,0,$len-18);
return (substr($wwn,0,2)!='_3' || preg_match('/.[_-]/',$wwn)) ? $id : substr($id,0,$len-18);
}
function device_desc(&$disk) {
global $var;