From: Ashley M. K. <as...@pc...> - 2003-04-01 08:01:19
|
Bruno Tavares wrote: >Just add the following code to the "processVarTags" function in idsShared.pm > >------ begin ------- > my @files_to_include = ($pageContent =~ >/<![- ]*file:(.*?)[- ]*>/sg); > foreach my $file (@files_to_include) { > open(FTI, "<$file"); > my $file_content; > while(<FTI>) { $file_content .= $_; } > close(FTI); > $pageContent =~ s/<![- ]*file:$file[- ]*>/$file_content/sg; > } >---- end --- > > This has now been committed, after adding Barry's little fix: >I have added a wrapper test of "if (-r $file) { }" inside the foreach loop. It looked like putting an invalid filename (or bad relative location) in one of these tags would result in a server error. Other than that, it looks good. > It should be available as soon as I update CVS. -- H| I haven't lost my mind; it's backed up on tape somewhere. +-------------------------------------------------------------------- Ashley M. Kirchner <mailto:as...@pc...> . 303.442.6410 x130 IT Director / SysAdmin / WebSmith . 800.441.3873 x130 Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6 http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A. |