Procházet zdrojové kódy

Removing learnpath::escape_string

Julio Montoya před 12 roky
rodič
revize
542dff144e

+ 2 - 2
main/newscorm/aicc_hacp.php

@@ -91,10 +91,10 @@ if (!empty($_REQUEST['command'])) {
         case 'getparam':
             // Request for all available data to be printed out in the answer.
             if (!empty($_REQUEST['version'])) {
-                $hacp_version = learnpath::escape_string($_REQUEST['version']);
+                $hacp_version = Database::escape_string($_REQUEST['version']);
             }
             if (!empty($_REQUEST['session_id'])) {
-                $hacp_session_id = learnpath::escape_string($_REQUEST['session_id']);
+                $hacp_session_id = Database::escape_string($_REQUEST['session_id']);
             }
             $error_code = 0;
             $error_text = $errors[$error_code];

+ 1 - 0
main/newscorm/learnpath.class.php

@@ -1324,6 +1324,7 @@ class learnpath {
      * Escapes a string with the available database escape function
      * @param	string	String to escape
      * @return	string	String escaped
+     * @deprecated use  Database::escape_string
      */
     public function escape_string($string) {
         //if ($this->debug > 0) { error_log('New LP - In learnpath::escape_string('.$string.')', 0); }

+ 4 - 6
main/newscorm/scormResource.class.php

@@ -113,9 +113,8 @@ class scormResource {
      * @return	string	Path for this resource
      */
     public function get_path() {
-        if (!empty($this->href)) {
-            require_once 'learnpath.class.php';
-            return learnpath::escape_string($this->href);
+        if (!empty($this->href)) {            
+            return Database::escape_string($this->href);
         } else {
             return '';
         }
@@ -126,9 +125,8 @@ class scormResource {
      * @return	string	generally 'asset' or 'sco' as these are the only two values defined in SCORM 1.2
      */
     public function get_scorm_type() {
-        if (!empty($this->scormtype)){
-            require_once 'learnpath.class.php';
-            return learnpath::escape_string($this->scormtype);
+        if (!empty($this->scormtype)) {            
+            return Database::escape_string($this->scormtype);
         } else {
             return '';
         }