Changeset 8483 for extensions/FacebookPlug/Server/include/common.php
- Timestamp:
- Jan 7, 2011, 12:03:31 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/FacebookPlug/Server/include/common.php
r8425 r8483 21 21 defined('FACEBOOKPLUG_ROOT_PATH') or trigger_error('Hacking attempt!', E_USER_ERROR); 22 22 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 // 29 if( !@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 } 48 if ( !empty($_SERVER["PATH_INFO"]) ) 49 { 50 $_SERVER["PATH_INFO"] = addslashes($_SERVER["PATH_INFO"]); 51 } 52 23 53 require_once(FACEBOOKPLUG_ROOT_PATH . 'include/constants.php'); 24 54 require_once(FACEBOOKPLUG_ROOT_PATH . 'include/constants_secret.php'); … … 32 62 include(FACEBOOKPLUG_ROOT_PATH . 'include/config_default.php'); 33 63 64 // Log on db 65 fbp_db_log(); 66 34 67 // Init Facebook 35 68 $facebook = new Facebook(array( … … 39 72 )); 40 73 41 //~ print_r($_COOKIE);42 43 44 function d($d)45 {46 echo '<pre>';47 print_r($d);48 echo '</pre>';49 }50 51 74 $session = $facebook->getSession(); 75 //~ var_dump($session); 52 76 // Session based graph API call. 53 77 if (! $session) … … 58 82 ( 59 83 //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' 61 88 )); 62 89 header( 'Request-URI: '.$url );
Note: See TracChangeset
for help on using the changeset viewer.