? modules/comment/comment-node-type-form.js
? sites/default/files
? sites/default/settings.php
Index: includes/path.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/path.inc,v
retrieving revision 1.33
diff -u -p -r1.33 path.inc
--- includes/path.inc	3 Apr 2009 17:41:32 -0000	1.33
+++ includes/path.inc	27 Apr 2009 15:28:58 -0000
@@ -262,3 +262,29 @@ function drupal_match_path($path, $patte
   }
   return (bool)preg_match($regexps[$patterns], $path);
 }
+
+/**
+ * Returns the current URL path of the page being viewed.
+ *
+ * Example #1: On viewing http://example.com/node/306 this function
+ * returns "node/306".
+ *
+ * Example #2: On viewing http://example.com/drupalfolder/node/306 this
+ * function returns "node/306" while base_path() returns "/drupalfolder/".
+ *
+ * Example #3: On viewing "http://example.com/path/alias" which is a path
+ * alias for "http://example.com/node/306", this function returns "node/306" 
+ * as opposed to the path alias.
+ *
+ * NOTE: This function is not available in hook_boot and you should use
+ * $_GET['q'] instead. Also, be careful in the case of Example #3 if you
+ * use it in hook_boot as it will contain "path/alias". Calling
+ * drupal_bootstrap(DRUPAL_BOOTSTRAP_PATH) makes this
+ * function available with a return value of "node/306".
+ *
+ * @return
+ *   The current Drupal path.
+ */
+function current_path() {
+  return $_GET['q'];
+}
Index: modules/simpletest/tests/path.test
===================================================================
RCS file: modules/simpletest/tests/path.test
diff -N modules/simpletest/tests/path.test
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/simpletest/tests/path.test	27 Apr 2009 15:28:58 -0000
@@ -0,0 +1,33 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Provides SimpleTests for core path handling functionality.
+ */
+
+class PathsTestCase extends DrupalWebTestCase {
+  /**
+   * Implementation of getInfo().
+   */
+  public static function getInfo() {
+    return array (
+      'name' => t('Path'),
+      'description' => t('Test overall functionality of the path system.'),
+      'group' => t('Path'),
+    );
+  }
+
+  /**
+   * Test integrity of current_path() function
+   */
+  function testCurrentPath() {
+    // Initialize a series of comparisons between current_path and $_GET['q'] for various path values.
+    $_GET['q'] = '/';
+    $this->assertEqual(current_path(), $_GET['q'], t('Test integrity of current_path() compared with backslash'));
+    $_GET['q'] = '';
+    $this->assertEqual(current_path(), $_GET['q'], t('Test integrity of current_path() compared with empty string'));
+    $_GET['q'] = $this->randomName(); //Set $_GET['q'] to a random string for comparison.	
+    $this->assertEqual(current_path(), $_GET['q'], t('Test integrity of current_path() compared with random string path'));
+  }
+}
