Changeset 8280
- Timestamp:
- 09/05/09 20:35:56 (4 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/branches/2.6/amp_conf/htdocs/admin/functions.inc.php
r8273 r8280 1718 1718 } 1719 1719 } 1720 } else if (preg_match( "/^\s*#include\s+(.*)\s*([;#].*)?/",$line,$matches)) {1720 } else if (preg_match('/^(?:\s*)#include(?:\s+)["\']{0,1}([^"\']*)["\']{0,1}(\s*[;#].*)?$/',$line,$matches)) { 1721 1721 // include another file 1722 1722 1723 1723 if ($matches[1][0] == "/") { 1724 1724 // absolute path 1725 $filename = $matches[1];1725 $filename = trim($matches[1]); 1726 1726 } else { 1727 1727 // relative path 1728 $filename = dirname($filename)."/". $matches[1];1728 $filename = dirname($filename)."/".trim($matches[1]); 1729 1729 } 1730 1730 … … 1760 1760 // if the file does not, copy if from the template. 1761 1761 // TODO: is this logical? 1762 // TODO: don't use hardcoded path...?1763 1762 if (!file_exists($filename)) { 1764 1763 if (!copy( rtrim($amp_conf["ASTETCDIR"],"/")."/voicemail.conf.template", $filename )){ … … 1802 1801 } 1803 1802 1804 } else if (preg_match( "/^(\s*)#include(\s+)(.*)(\s*[;#].*)?$/",$line,$matches)) {1803 } else if (preg_match('/^(\s*)#include(\s+)["\']{0,1}([^"\']*)["\']{0,1}(\s*[;#].*)?$/',$line,$matches)) { 1805 1804 // include another file 1806 1805 //DEBUG echo "\ninclude ".$matches[3]."<blockquote>"; … … 1813 1812 if ($matches[3][0] == "/") { 1814 1813 // absolute path 1815 $include_filename = $matches[3];1814 $include_filename = trim($matches[3]); 1816 1815 } else { 1817 1816 // relative path 1818 $include_filename = dirname($filename)."/". $matches[3];1817 $include_filename = dirname($filename)."/".trim($matches[3]); 1819 1818 } 1820 1819 1821 $output[] = $matches[1]."#include".$matches[2].$matches[3].$matches[4];1820 $output[] = trim($matches[0]); 1822 1821 write_voicemailconf($include_filename, $vmconf, $section, $iteration+1); 1823 1822
