| 1 |
<?php |
<?php |
| 2 |
// $Id: import_html_process.inc,v 1.5.4.13 2009/05/09 14:16:30 dman Exp $ |
// $Id: import_html_process.inc,v 1.5.4.14 2009/05/17 15:12:46 dman Exp $ |
| 3 |
/** |
/** |
| 4 |
* @file Actual routines for importing files. |
* @file Actual routines for importing files. |
| 5 |
* |
* |
| 124 |
'dest' => $dest_path, |
'dest' => $dest_path, |
| 125 |
'rel_path' => $rel_path, |
'rel_path' => $rel_path, |
| 126 |
); |
); |
|
|
|
| 127 |
// Handle files that are resources. |
// Handle files that are resources. |
| 128 |
// Copy them into the files folder and return |
// Copy them into the files folder and return |
| 129 |
$checkfile = is_local($source_path) ? $source_path : $dest_path; |
$checkfile = is_local($source_path) ? $source_path : $dest_path; |
| 1011 |
// No change, Chop suffix instead. |
// No change, Chop suffix instead. |
| 1012 |
// Take care - don't break a path like |
// Take care - don't break a path like |
| 1013 |
// /path/site-mirror/drupal.org/about |
// /path/site-mirror/drupal.org/about |
| 1014 |
// incorrectly |
// incorrectly. So make sure that we split off the basename, chop its suffix, then glue it back onto the dirname |
| 1015 |
$path = dirname($path) .'/'. preg_replace('|\.[^\.]+$|', "", basename($path)); |
// $path = (! empty($path) ? dirname($path) .'/' : '') . preg_replace('|\.[^\.]+$|', "", basename($path)); |
| 1016 |
|
// Alternatively - avoid matching bacl up the tree |
| 1017 |
|
$path = preg_replace('|([^/]*)\.[^\.]+$|', '$1', $path); |
| 1018 |
} |
} |
| 1019 |
} |
} |
| 1020 |
|
|
| 1021 |
return $path; |
return $path; |
| 1022 |
} |
} |
| 1023 |
|
|