Commit 9dbae25f authored by Shakarim Sapa's avatar Shakarim Sapa

- Fix

parent a3444914
...@@ -47,13 +47,16 @@ class ReplaceController extends Controller ...@@ -47,13 +47,16 @@ class ReplaceController extends Controller
{ {
foreach($data as $i=>$item) foreach($data as $i=>$item)
{ {
// $item->text = str_replace('http://task-on.com/', 'https://task-on.com/', $item->text); if ($item->text!='')
$item->text = str_replace('https://task-on.com/', '/', $item->text);
if (!$item->save())
{ {
throw new ServerErrorHttpException(current(current($item->getErrors()))); // $item->text = str_replace('http://task-on.com/', 'https://task-on.com/', $item->text);
$item->text = str_replace('https://task-on.com/', '/', $item->text);
if (!$item->save())
{
throw new ServerErrorHttpException(current(current($item->getErrors())));
}
echo ($i+1)." of ".count($data)." successfully updated\n";
} }
echo ($i+1)." of ".count($data)." successfully updated\n";
} }
$transaction->commit(); $transaction->commit();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment