private function isOn()
 {
     if (self::$inputsQuoted === null) {
         self::$inputsQuoted = (bool) (get_magic_quotes_gpc() == 1);
     }
     return self::$inputsQuoted;
 }
 function test_turnOff()
 {
     $mq = new MagicQuotes();
     $mq->turnOff();
     $this->assertEquals($this->testString, $_GET['test']);
     $mq->turnOff();
     $mq->turnOff();
     $mq->turnOff();
     $this->assertEquals($this->testString, $_GET['test']);
     $mq->turnOn();
     $mq->turnOff();
     $this->assertEquals($this->testString, $_GET['test']);
 }
Пример #3
0
 /**
  * Replacement function for the original {@link get_magic_quotes_gpc()}.
  * Use this function to avoid E_DEPRECATED warnings.
  *
  * @return bool Returns the current setting.
  */
 public static function getGpc()
 {
     if (self::$magicQuotesGPC === null) {
         if (!function_exists('get_magic_quotes_gpc')) {
             self::$magicQuotesGPC = false;
         } elseif (version_compare(PHP_VERSION, '5.3.0') < 0) {
             self::$magicQuotesGPC = get_magic_quotes_gpc();
         } else {
             self::$magicQuotesGPC = Util::iniGetBool('magic_quotes_gpc');
             if (self::$magicQuotesGPC === null) {
                 self::$magicQuotesGPC = @get_magic_quotes_gpc();
             }
         }
     }
     return self::$magicQuotesGPC;
 }
Пример #4
0
 /**
  * Reads an HTTP POST variable.
  * NOTES:
  * - The result might be an array.
  * - If magic_quotes_gpc is enabled, the function will strip all slashes
  *   from the variable (if it is a string) before returning it.
  *
  * @param string $name The name of the POST variable.
  * @param mixed $default Optional. The default value to return if the
  *     specified variable is undefined. Default is NULL.
  * @return mixed
  * @see readGET()
  * @see readAll()
  * @see $_POST
  */
 public static function readPOST($name, $default = null)
 {
     $value = isset($_POST[$name]) ? $_POST[$name] : $default;
     if (is_string($value) and MagicQuotes::getGpc()) {
         return stripslashes($value);
     } else {
         return $value;
     }
 }
Пример #5
0
$woche[] = 'Montag';
$woche[] = 'Dienstag';
$woche[] = 'Mittwoch';
$woche[] = 'Donnerstag';
$woche[] = 'Freitag';
$woche[] = 'Samstag';
// Variabeln fuer Benutzer Avatare
$img_person_dir['intern'] = $root . "img/person/";
$img_person_dir['extern'] = "/img/person/";
$max_avatar_groesse = 100000;
// Code, der in HTML umgewandelt werden soll
$code_html = array('b' => '<b>$1</b>', 'i' => '<i>$1</i>', 'u' => '<u>$1</u>', 's' => '<s>$1</s>', 'strong' => '<strong>$1' . '</strong>', 'center' => '<div align=' . '\\"' . 'center' . '\\"' . '>$1</div>', 'quote' => '<blockquote>$1</blockquote>', 'code' => '<code>$1</code>', 'pre' => '<pre>$1</pre>');
/////////////////////// Anfang OOP ///////////////////////
// handle different magic quotes configurations
require_once $root . 'class_MagicQuotes.php';
$magicQuotes = new MagicQuotes();
$magicQuotes->turnOn();
unset($magicQuotes);
// object containing every information needed for output
// $output->out() formates everything and send it to the user
$output = new output();
// default language
$output->lang = 'de';
// navigation links
$output->nav['start'] = $root;
$output->nav['help'] = $root . 'dokumentation/';
$output->nav['up'] = '../';
$output->nav['author'] = $root . 'about/';
$output->nav['copyright'] = $root . 'COPYING';
// title and headline
$output->title[0] = 'infoschool';