You are here

function PclZip::privDisableMagicQuotes in Quiz 6.6

Same name and namespace in other branches
  1. 6.5 includes/moodle/lib/pclzip/pclzip.lib.php \PclZip::privDisableMagicQuotes()
6 calls to PclZip::privDisableMagicQuotes()
PclZip::delete in includes/moodle/lib/pclzip/pclzip.lib.php
PclZip::privAdd in includes/moodle/lib/pclzip/pclzip.lib.php
PclZip::privCreate in includes/moodle/lib/pclzip/pclzip.lib.php
PclZip::privExtractByRule in includes/moodle/lib/pclzip/pclzip.lib.php
PclZip::privList in includes/moodle/lib/pclzip/pclzip.lib.php

... See full list

File

includes/moodle/lib/pclzip/pclzip.lib.php, line 5335

Class

PclZip

Code

function privDisableMagicQuotes() {

  //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privDisableMagicQuotes', "");
  $v_result = 1;

  // ----- Look if function exists
  if (!function_exists("get_magic_quotes_runtime") || !function_exists("set_magic_quotes_runtime")) {

    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Functions *et_magic_quotes_runtime are not supported");

    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }

  // ----- Look if already done
  if ($this->magic_quotes_status != -1) {

    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "magic_quote already disabled");

    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }

  // ----- Get and memorize the magic_quote value
  $this->magic_quotes_status = @get_magic_quotes_runtime();

  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Current magic_quotes_runtime status is '".($this->magic_quotes_status==0?'disable':'enable')."'");

  // ----- Disable magic_quotes
  if ($this->magic_quotes_status == 1) {

    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Disable magic_quotes");
    @set_magic_quotes_runtime(0);
  }

  // ----- Return

  //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
  return $v_result;
}