|
Lines 324-334
class NativeImportDom {
|
Link Here
|
|---|
|
| 324 |
if (($href = $node->getChildByName('href'))) { |
324 |
if (($href = $node->getChildByName('href'))) { |
| 325 |
$url = $href->getAttribute('src'); |
325 |
$url = $href->getAttribute('src'); |
| 326 |
if ($isCommandLine || NativeImportDom::isAllowedMethod($url)) { |
326 |
if ($isCommandLine || NativeImportDom::isAllowedMethod($url)) { |
| 327 |
if ($isCommandLine && NativeImportDom::isRelativePath($url)) { |
|
|
| 328 |
// The command-line tool does a chdir; we need to prepend the original pathname to relative paths so we're not looking in the wrong place. |
| 329 |
$url = PWD . '/' . $url; |
| 330 |
} |
| 331 |
|
| 332 |
$originalName = basename($url); |
327 |
$originalName = basename($url); |
| 333 |
$newName .= $publicFileManager->getExtension($originalName); |
328 |
$newName .= $publicFileManager->getExtension($originalName); |
| 334 |
if (!$publicFileManager->copyJournalFile($journal->getId(), $url, $newName)) { |
329 |
if (!$publicFileManager->copyJournalFile($journal->getId(), $url, $newName)) { |
|
Lines 394-404
class NativeImportDom {
|
Link Here
|
|---|
|
| 394 |
if (($href = $node->getChildByName('href'))) { |
389 |
if (($href = $node->getChildByName('href'))) { |
| 395 |
$url = $href->getAttribute('src'); |
390 |
$url = $href->getAttribute('src'); |
| 396 |
if ($isCommandLine || NativeImportDom::isAllowedMethod($url)) { |
391 |
if ($isCommandLine || NativeImportDom::isAllowedMethod($url)) { |
| 397 |
if ($isCommandLine && NativeImportDom::isRelativePath($url)) { |
|
|
| 398 |
// The command-line tool does a chdir; we need to prepend the original pathname to relative paths so we're not looking in the wrong place. |
| 399 |
$url = PWD . '/' . $url; |
| 400 |
} |
| 401 |
|
| 402 |
$originalName = basename($url); |
392 |
$originalName = basename($url); |
| 403 |
$newName .= $publicFileManager->getExtension($originalName); |
393 |
$newName .= $publicFileManager->getExtension($originalName); |
| 404 |
if (!$publicFileManager->copyJournalFile($journal->getId(), $url, $newName)) { |
394 |
if (!$publicFileManager->copyJournalFile($journal->getId(), $url, $newName)) { |
|
Lines 996-1006
class NativeImportDom {
|
Link Here
|
|---|
|
| 996 |
if (($href = $node->getChildByName('href'))) { |
986 |
if (($href = $node->getChildByName('href'))) { |
| 997 |
$url = $href->getAttribute('src'); |
987 |
$url = $href->getAttribute('src'); |
| 998 |
if ($isCommandLine || NativeImportDom::isAllowedMethod($url)) { |
988 |
if ($isCommandLine || NativeImportDom::isAllowedMethod($url)) { |
| 999 |
if ($isCommandLine && NativeImportDom::isRelativePath($url)) { |
|
|
| 1000 |
// The command-line tool does a chdir; we need to prepend the original pathname to relative paths so we're not looking in the wrong place. |
| 1001 |
$url = PWD . '/' . $url; |
| 1002 |
} |
| 1003 |
|
| 1004 |
if (($fileId = $articleFileManager->copyPublicFile($url, $href->getAttribute('mime_type')))===false) { |
989 |
if (($fileId = $articleFileManager->copyPublicFile($url, $href->getAttribute('mime_type')))===false) { |
| 1005 |
$errors[] = array('plugins.importexport.native.import.error.couldNotCopy', array('url' => $url)); |
990 |
$errors[] = array('plugins.importexport.native.import.error.couldNotCopy', array('url' => $url)); |
| 1006 |
return false; |
991 |
return false; |
|
Lines 1050-1060
class NativeImportDom {
|
Link Here
|
|---|
|
| 1050 |
if (($href = $node->getChildByName('href'))) { |
1035 |
if (($href = $node->getChildByName('href'))) { |
| 1051 |
$url = $href->getAttribute('src'); |
1036 |
$url = $href->getAttribute('src'); |
| 1052 |
if ($isCommandLine || NativeImportDom::isAllowedMethod($url)) { |
1037 |
if ($isCommandLine || NativeImportDom::isAllowedMethod($url)) { |
| 1053 |
if ($isCommandLine && NativeImportDom::isRelativePath($url)) { |
|
|
| 1054 |
// The command-line tool does a chdir; we need to prepend the original pathname to relative paths so we're not looking in the wrong place. |
| 1055 |
$url = PWD . '/' . $url; |
| 1056 |
} |
| 1057 |
|
| 1058 |
if (($fileId = $articleFileManager->copyPublicFile($url, $href->getAttribute('mime_type')))===false) { |
1038 |
if (($fileId = $articleFileManager->copyPublicFile($url, $href->getAttribute('mime_type')))===false) { |
| 1059 |
$errors[] = array('plugins.importexport.native.import.error.couldNotCopy', array('url' => $url)); |
1039 |
$errors[] = array('plugins.importexport.native.import.error.couldNotCopy', array('url' => $url)); |
| 1060 |
return false; |
1040 |
return false; |
|
Lines 1206-1216
class NativeImportDom {
|
Link Here
|
|---|
|
| 1206 |
if (($href = $fileNode->getChildByName('href'))) { |
1186 |
if (($href = $fileNode->getChildByName('href'))) { |
| 1207 |
$url = $href->getAttribute('src'); |
1187 |
$url = $href->getAttribute('src'); |
| 1208 |
if ($isCommandLine || NativeImportDom::isAllowedMethod($url)) { |
1188 |
if ($isCommandLine || NativeImportDom::isAllowedMethod($url)) { |
| 1209 |
if ($isCommandLine && NativeImportDom::isRelativePath($url)) { |
|
|
| 1210 |
// The command-line tool does a chdir; we need to prepend the original pathname to relative paths so we're not looking in the wrong place. |
| 1211 |
$url = PWD . '/' . $url; |
| 1212 |
} |
| 1213 |
|
| 1214 |
if (($fileId = $articleFileManager->copySuppFile($url, $href->getAttribute('mime_type')))===false) { |
1189 |
if (($fileId = $articleFileManager->copySuppFile($url, $href->getAttribute('mime_type')))===false) { |
| 1215 |
$errors[] = array('plugins.importexport.native.import.error.couldNotCopy', array('url' => $url)); |
1190 |
$errors[] = array('plugins.importexport.native.import.error.couldNotCopy', array('url' => $url)); |
| 1216 |
return false; |
1191 |
return false; |