Commit 3ec60aea authored by Jerome Mariette's avatar Jerome Mariette
Browse files

fix preg_split bug

parent 6ef148e8
......@@ -61,11 +61,11 @@ class tx_nG6_eid {
*/
function get_file_size($ids, $data_folder) {
$src_directories = Array();
$vals = preg_split(";", $ids);
$vals = preg_split("/;/", $ids);
$fileSize = 0;
foreach($vals as $val) {
if ($val != "undefined" && $val != "") {
$id = preg_split("_", $val);
$id = preg_split("/_/", $val);
if ($id[0] == "data") {
$run = $this->get_run($id[1]);
if (!in_array($data_folder.$run["directory"], $src_directories)) {
......@@ -132,12 +132,12 @@ class tx_nG6_eid {
function get_download_file($ids, $data_folder, $tmp_folder) {
$src_directories = Array();
$dest_directories = Array();
$vals = preg_split(";", $ids);
$vals = preg_split("/;/", $ids);
$temporary_dir = $this->createRandomArchiveName($tmp_folder);
$charToBeSubstituted = array(' ','/'); //characters to be replaced in the names of the run, the analyses....
foreach($vals as $val) {
if ($val != "undefined" && $val != "") {
$id = preg_split("_", $val);
$id = preg_split("/_/", $val);
if ($id[0] == "data") {
$run = $this->get_run($id[1]);
if (!in_array($data_folder.$run["directory"], $src_directories)) {
......@@ -153,7 +153,7 @@ class tx_nG6_eid {
foreach($this->get_run_analysis($id[1]) as $analyse_id => $analyse_values) {
if (!in_array($data_folder.$analyse_values["directory"], $src_directories)) {
$src_directories[] = $data_folder.$analyse_values["directory"];
$aid = preg_split("_", $analyse_id);
$aid = preg_split("/_/", $analyse_id);
$dest_directories[] = $temporary_dir."/Project_".str_replace($charToBeSubstituted, '_', $run["project_name"]).'.'.$run["project_id"]."/Run_".str_replace($charToBeSubstituted, '_', $run["name"]).".".$id[1]."/Analyse_".str_replace($charToBeSubstituted, '_', $analyse_values["name"]).".".$aid;
}
}
......
Supports Markdown
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