commit 91e601ef5e3ad19c11180f25f9cb2f57c5275a07
Author: Daniel Neis Araujo <daniel@npd.ufsc.br>
Date:   Tue Mar 30 15:55:23 2010 -0300

    Applying patch to correct issue.

diff --git a/lib/moodlelib.php b/lib/moodlelib.php
index c25aa2a..5334456 100644
--- a/lib/moodlelib.php
+++ b/lib/moodlelib.php
@@ -8318,25 +8318,13 @@ function object_property_exists( $obj, $property ) {
 /**
  * Detect a custom script replacement in the data directory that will
  * replace an existing moodle script
- * @param string $urlpath path to the original script
  * @return string full path name if a custom script exists
  * @return bool false if no custom script exists
  */
-function custom_script_path($urlpath='') {
+function custom_script_path() {
     global $CFG;
 
-    // set default $urlpath, if necessary
-    if (empty($urlpath)) {
-        $urlpath = qualified_me(); // e.g. http://www.this-server.com/moodle/this-script.php
-    }
-
-    // $urlpath is invalid if it is empty or does not start with the Moodle wwwroot
-    if (empty($urlpath) or (strpos($urlpath, $CFG->wwwroot) === false )) {
-        return false;
-    }
-
-    // replace wwwroot with the path to the customscripts folder and clean path
-    $scriptpath = $CFG->customscripts . clean_param(substr($urlpath, strlen($CFG->wwwroot)), PARAM_PATH);
+    $scriptpath = $CFG->customscripts . clean_param(me(), PARAM_PATH);
 
     // remove the query string, if any
     if (($strpos = strpos($scriptpath, '?')) !== false) {
