How change de eregi to preg_match in this code?

Shape-Shifter

New Member
\[code\]if (preg_match('^'.preg_quote($this->config_document_root), $filename)) { $AbsoluteFilename = $filename; $this->DebugMessage('ResolveFilenameToAbsolute() NOT prepending $this->config_document_root ('.$this->config_document_root.') to $filename ('.$filename.') resulting in ($AbsoluteFilename = "'.$AbsoluteFilename.'")', __FILE__, __LINE__); } else { $AbsoluteFilename = $this->config_document_root.$filename; $this->DebugMessage('ResolveFilenameToAbsolute() prepending $this->config_document_root ('.$this->config_document_root.') to $filename ('.$filename.') resulting in ($AbsoluteFilename = "'.$AbsoluteFilename.'")', __FILE__, __LINE__); }}\[/code\]This code has been resolved with instructions of the first answer, but how I can fix this code too? \[code\]if (!$this->config_allow_src_above_docroot && !preg_match('^'.preg_quote(str_replace(DIRECTORY_SEPARATOR, '/', realpath($this->config_document_root))), $AbsoluteFilename)) { \[/code\]Solved, thanks for all answers!
 
Back
Top