Ignore:
Timestamp:
Jan 7, 2011, 12:03:31 AM (13 years ago)
Author:
rub
Message:

Server upload

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/FacebookPlug/Server/include/common.php

    r8425 r8483  
    2121defined('FACEBOOKPLUG_ROOT_PATH') or trigger_error('Hacking attempt!', E_USER_ERROR);
    2222
     23@set_magic_quotes_runtime(false); // Disable magic_quotes_runtime
     24
     25//
     26// addslashes to vars if magic_quotes_gpc is off this is a security
     27// precaution to prevent someone trying to break out of a SQL statement.
     28//
     29if( !@get_magic_quotes_gpc() )
     30{
     31  function sanitize_mysql_kv(&$v, $k)
     32  {
     33    $v = addslashes($v);
     34  }
     35  if( is_array( $_GET ) )
     36  {
     37    array_walk_recursive( $_GET, 'sanitize_mysql_kv' );
     38  }
     39  if( is_array( $_POST ) )
     40  {
     41    array_walk_recursive( $_POST, 'sanitize_mysql_kv' );
     42  }
     43  if( is_array( $_COOKIE ) )
     44  {
     45    array_walk_recursive( $_COOKIE, 'sanitize_mysql_kv' );
     46  }
     47}
     48if ( !empty($_SERVER["PATH_INFO"]) )
     49{
     50  $_SERVER["PATH_INFO"] = addslashes($_SERVER["PATH_INFO"]);
     51}
     52
    2353require_once(FACEBOOKPLUG_ROOT_PATH . 'include/constants.php');
    2454require_once(FACEBOOKPLUG_ROOT_PATH . 'include/constants_secret.php');
     
    3262include(FACEBOOKPLUG_ROOT_PATH . 'include/config_default.php');
    3363
     64// Log on db
     65fbp_db_log();
     66
    3467// Init Facebook
    3568$facebook = new Facebook(array(
     
    3972));
    4073
    41 //~ print_r($_COOKIE);
    42 
    43 
    44 function d($d)
    45 {
    46   echo '<pre>';
    47   print_r($d);
    48   echo '</pre>';
    49 }
    50 
    5174$session = $facebook->getSession();
     75//~ var_dump($session);
    5276// Session based graph API call.
    5377if (! $session)
     
    5882    (
    5983      //ici on demande les permissions email, publication sur le mur, et changement du status
    60       'req_perms' => 'email,publish_stream,status_update',
     84      //'req_perms' => 'email,publish_stream,status_update',
     85      'req_perms' => 'publish_stream',
     86      'display' => 'popup',
     87      'cancel_url' => 'http://'.$_SERVER['HTTP_HOST'].'/'.FBP_VERSION.'/cancel.php'
    6188    ));
    6289  header( 'Request-URI: '.$url );
Note: See TracChangeset for help on using the changeset viewer.