summaryrefslogtreecommitdiffstats
path: root/WebKitTools/DumpRenderTree/android/view_source.php
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-05 14:36:32 +0100
committerBen Murdoch <benm@google.com>2011-05-10 15:38:30 +0100
commitf05b935882198ccf7d81675736e3aeb089c5113a (patch)
tree4ea0ca838d9ef1b15cf17ddb3928efb427c7e5a1 /WebKitTools/DumpRenderTree/android/view_source.php
parent60fbdcc62bced8db2cb1fd233cc4d1e4ea17db1b (diff)
downloadexternal_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.zip
external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.gz
external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.bz2
Merge WebKit at r74534: Initial merge by git.
Change-Id: I6ccd1154fa1b19c2ec2a66878eb675738735f1eb
Diffstat (limited to 'WebKitTools/DumpRenderTree/android/view_source.php')
-rw-r--r--WebKitTools/DumpRenderTree/android/view_source.php53
1 files changed, 0 insertions, 53 deletions
diff --git a/WebKitTools/DumpRenderTree/android/view_source.php b/WebKitTools/DumpRenderTree/android/view_source.php
deleted file mode 100644
index fc9ae31..0000000
--- a/WebKitTools/DumpRenderTree/android/view_source.php
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-# Copyright (C) 2010 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-###############################################################################
-
-# Show the source of the test.
-#
-# Usage:
-# view_source.php?src=PATH
-# where
-# PATH - relative path in the LayoutTests dir
-
- # Global variables
- # The server document root is LayoutTests/http/tests. See run_apache2.py.
- $rootDir = realpath($_SERVER['DOCUMENT_ROOT'] . '..' . DIRECTORY_SEPARATOR . '..');
-
- function getAbsolutePath($relPath) {
- global $rootDir;
- return $rootDir . DIRECTORY_SEPARATOR . $relPath;
- }
-
- function main() {
- global $rootDir;
-
- # Very primitive check if path tries to go above DOCUMENT_ROOT or is absolute
- if (strpos($_GET['src'], "..") !== False ||
- substr($_GET['src'], 0, 1) == DIRECTORY_SEPARATOR) {
- return;
- }
-
- # If we don't want realpath to append any prefixes we need to pass it an absolute path
- $src = realpath(getAbsolutePath($_GET['src']));
-
- echo "<html><body>";
- # TODO: Add link following and syntax highlighting for html and js.
- highlight_string(file_get_contents($src));
- echo "</body></html>";
- }
-
- main();
-?>