[system] / branches / rel-2-2-dev / webwork-modperl / lib / WeBWorK / ContentGenerator / Instructor / PGProblemEditor.pm Repository:
ViewVC logotype

Diff of /branches/rel-2-2-dev/webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 4345 Revision 4346
475 die "tempFilePath is unsafe!" unless path_is_subdir($tempFilePath, $ce->{courseDirs}->{templates}, 1); # 1==path can be relative to dir 475 die "tempFilePath is unsafe!" unless path_is_subdir($tempFilePath, $ce->{courseDirs}->{templates}, 1); # 1==path can be relative to dir
476 eval { $problemContents = WeBWorK::Utils::readFile($tempFilePath) }; 476 eval { $problemContents = WeBWorK::Utils::readFile($tempFilePath) };
477 $problemContents = $@ if $@; 477 $problemContents = $@ if $@;
478 $inputFilePath = $tempFilePath; 478 $inputFilePath = $tempFilePath;
479 } elsif (-r $editFilePath and not -d $editFilePath) { 479 } elsif (-r $editFilePath and not -d $editFilePath) {
480 die "editFilePath is unsafe!" unless path_is_subdir($editFilePath, $ce->{courseDirs}->{templates}, 1); # 1==path can be relative to dir 480 die "editFilePath is unsafe!" unless path_is_subdir($editFilePath, $ce->{courseDirs}->{templates}, 1) # 1==path can be relative to dir
481 || $editFilePath eq $ce->{webworkFiles}{screenSnippets}{setHeader}
482 || $editFilePath eq $ce->{webworkFiles}{hardcopySnippets}{hardcopyHeader};
481 eval { $problemContents = WeBWorK::Utils::readFile($editFilePath) }; 483 eval { $problemContents = WeBWorK::Utils::readFile($editFilePath) };
482 $problemContents = $@ if $@; 484 $problemContents = $@ if $@;
483 $inputFilePath = $editFilePath; 485 $inputFilePath = $editFilePath;
484 } else { # file not existing is not an error 486 } else { # file not existing is not an error
485 #warn "No file exists"; 487 #warn "No file exists";

Legend:
Removed from v.4345  
changed lines
  Added in v.4346

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9