Skip to content

Commit

Permalink
Clean up ugly hack in CopyTo. Do not modify the object resulting in c…
Browse files Browse the repository at this point in the history
…ached crap
  • Loading branch information
Isaac Connor committed Aug 13, 2019
1 parent 38a09bb commit 74e414e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/ZoneMinder/lib/ZoneMinder/Event.pm
Expand Up @@ -562,8 +562,8 @@ sub CopyTo {
return 'Old Storage path changed, Event has moved somewhere else.';
}

$$self{Storage} = $NewStorage;
( $NewPath ) = ( $self->Path(undef) =~ /^(.*)$/ ); # De-taint
$NewPath .= $self->Relative_Path();
$NewPath = ( $NewPath =~ /^(.*)$/ ); # De-taint
if ( $NewPath eq $OldPath ) {
$ZoneMinder::Database::dbh->commit();
return "New path and old path are the same! $NewPath";
Expand Down Expand Up @@ -685,7 +685,7 @@ sub MoveTo {

# Succeeded in copying all files, so we may now update the Event.
$$self{StorageId} = $$NewStorage{Id};
$$self{Storage} = $NewStorage;
$self->Storage($NewStorage);
$error .= $self->save();
if ( $error ) {
$ZoneMinder::Database::dbh->commit();
Expand Down

0 comments on commit 74e414e

Please sign in to comment.