Skip to content

Commit

Permalink
https://github.com/WWBN/AVideo-Storage/issues/30
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel committed May 16, 2022
1 parent b8ed16c commit 7e9fc5c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion install/fixSlashN.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@
$count = 0;
foreach ($videos as $value) {
$count++;
$newDescription = str_replace('\n', PHP_EOL, $value['description']);
//$newDescription = str_replace('\n', PHP_EOL, $value['description']);
$newDescription = preg_replace('/(\\\\)+n/', PHP_EOL, $value['description']);
$newDescription = preg_replace('/(\\\\)+/', PHP_EOL, $newDescription);
$newTitle = preg_replace('/(\\\\)+/', '', $value['title']);

if($newDescription !== $value['description']){
echo "Change ($count) [{$value['id']}]{$value['title']} ******".PHP_EOL;
$video = new Video('','',$value['id']);
$video->setTitle($newTitle);
$video->setDescription($newDescription);
$video->save(false, true);
}else{
Expand Down

0 comments on commit 7e9fc5c

Please sign in to comment.