Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hybridauth 2.13 #22

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
830 changes: 419 additions & 411 deletions include/hybridauth/Hybrid/Auth.php

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions include/hybridauth/Hybrid/Endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct($request = null) {
// with /index.php?hauth.done={provider}?{args}...
// >here we need to parse $_SERVER[QUERY_STRING]
$request = $_REQUEST;
if (strrpos($_SERVER["QUERY_STRING"], '?')) {
if (isset($_SERVER["QUERY_STRING"]) && strrpos($_SERVER["QUERY_STRING"], '?')) {
$_SERVER["QUERY_STRING"] = str_replace("?", "&", $_SERVER["QUERY_STRING"]);
parse_str($_SERVER["QUERY_STRING"], $request);
}
Expand Down Expand Up @@ -197,6 +197,12 @@ protected function authInit() {
if (!class_exists("Hybrid_Storage", false)) {
require_once realpath(dirname(__FILE__)) . "/Storage.php";
}
if (!class_exists("Hybrid_Exception", false)) {
require_once realpath(dirname(__FILE__)) . "/Exception.php";
}
if (!class_exists("Hybrid_Logger", false)) {
require_once realpath(dirname(__FILE__)) . "/Logger.php";
}

$storage = new Hybrid_Storage();

Expand All @@ -208,7 +214,7 @@ protected function authInit() {
Hybrid_Auth::initialize($storage->config("CONFIG"));
} catch (Exception $e) {
Hybrid_Logger::error("Endpoint: Error while trying to init Hybrid_Auth: " . $e->getMessage());
throw new Hybrid_Exception("Oophs. Error!");
throw new Hybrid_Exception( "Endpoint: Error while trying to init Hybrid_Auth: " . $e->getMessage(), $e->getCode(), $e );
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions include/hybridauth/Hybrid/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,15 @@ public static function error($message, $object = null) {
}
}

/**
* Dumps the data in the way suitable to be output in log files for debug purposes
*
* @param mixed $data
*
* @return string
*/
public static function dumpData($data) {
return var_export($data, true);
}

}
Loading