summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--devel.module65
1 files changed, 0 insertions, 65 deletions
diff --git a/devel.module b/devel.module
index 10b4715..99a675a 100644
--- a/devel.module
+++ b/devel.module
@@ -72,13 +72,6 @@ function devel_menu() {
'access arguments' => array('access devel information'),
'menu_name' => 'devel',
);
- $items['devel/source'] = array(
- 'title' => 'Display the PHP code of any file in your Drupal installation',
- 'page callback' => 'devel_display_source',
- 'access arguments' => array('display source code'),
- 'type' => MENU_CALLBACK,
- 'menu_name' => 'devel',
- );
$items['devel/menu/reset'] = array(
'title' => 'Rebuild menus',
'description' => 'Rebuild menu based on hook_menu() and revert any custom changes. All menu items return to their default settings.',
@@ -260,64 +253,6 @@ function devel_theme() { // &$cache, $type, $theme, $path
}
/**
- * Page callback to display syntax hilighted source code
- *
- * note: the path for this function is received via $_GET['path']
- * example http://www.example.com/devel/source?file=modules/node/node.module
- *
- * @param $standalone
- * Set to FALSE to place the code inside a Drupal page. Otherwise code displays on its own.
- */
-function devel_display_source($standalone = TRUE) {
- $path = $_GET['file'];
- // take out the nasties
- $path = str_replace('../', '', $path);
- $output = devel_highlight_file($path, $standalone);
- if ($output) {
- if ($standalone) {
- print $output;
- exit();
- }
- return $output;
- }
- else {
- drupal_set_message(t('Invalid file path'), 'error');
- drupal_not_found();
- }
-}
-
-/**
- * Return PHP highlighted file
- *
- * @param $path
- * path to the file
- * *warning* there is NO VALIDATION in this function
- * Beware of paths such as '../../../../../etc/apache/httpd.conf'
- *
- * @param $standalone
- * should the returned HTML be wrapped in a full <html> page or will it be output by Drupal?
- */
-function devel_highlight_file($path = NULL, $standalone = FALSE) {
- if (file_exists($path)) {
- $source = highlight_file($path, TRUE);
- // add anchor links before all functions so that we can link to a function within the source
- // ** commented out because regexes aren't working **
- //$source = preg_replace('!(\/\*\*.*?\*\/.*?)<br.*?function.*?#0000BB">(.*?)<\/span>!', '<a id="$2"></a> $0', $source);
- //$source = preg_replace('!(\/\*\*.*?\*\/).*?function.*?#0000BB">(.*?)<\/span>!', '<a id="$2"></a> $0', $source);
- if ($standalone) {
- $source = <<<EOT
-<head><title>$path</title></head>
-<body>$source</body>
-EOT;
- }
- return $source;
- }
- else {
- return FALSE;
- }
-}
-
-/**
* Implementation of hook_init().
*/
function devel_init() {