You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -139,8 +144,15 @@ public function replaceWith($file, $fileName)
139
144
140
145
if (false === $result_moved)
141
146
{
142
-
$ex = sprintf( esc_html__('The uploaded file could not be moved to %1$s. This is most likely an issue with permissions, or upload failed.', "enable-media-replace"), $targetFile );
143
-
thrownew \RuntimeException($ex);
147
+
if ($targetFileObj->exists())
148
+
{
149
+
Log::addDebug('Could remove file from tmp directory?');
150
+
}
151
+
else {
152
+
$ex = sprintf( esc_html__('The uploaded file could not be moved to %1$s. This is most likely an issue with permissions, or upload failed.', "enable-media-replace"), $targetFile );
153
+
thrownew \RuntimeException($ex);
154
+
}
155
+
144
156
}
145
157
146
158
// init targetFile.
@@ -513,10 +525,11 @@ protected function doSearchReplace($args = array())
513
525
// get relurls of both source and target.
514
526
$urls = $this->getRelativeURLS();
515
527
516
-
517
528
if ($args['thumbnails_only'])
518
529
{
519
-
foreach($urlsas$side => $data)
530
+
// if (isset($urls['source']['file']) && $urls['source'])
531
+
532
+
/*foreach($urls as $side => $data)
520
533
{
521
534
if (isset($data['base']))
522
535
{
@@ -526,7 +539,7 @@ protected function doSearchReplace($args = array())
526
539
{
527
540
unset($urls[$side]['file']);
528
541
}
529
-
}
542
+
} */
530
543
}
531
544
532
545
$search_urls = $urls['source'];
@@ -543,8 +556,18 @@ protected function doSearchReplace($args = array())
0 commit comments