@@ -41,36 +41,36 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | function isUserBot() |
| 43 | 43 | { |
| 44 | - preg_match('/bot|spider|google|twitter/i', $_SERVER['HTTP_USER_AGENT'], $matches); |
|
| 44 | + preg_match('/bot|spider|google|twitter/i', $_SERVER['HTTP_USER_AGENT'], $matches); |
|
| 45 | 45 | |
| 46 | - return (isset($matches[0])) ? true : false; |
|
| 46 | + return (isset($matches[0])) ? true : false; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | function configPropertyExists($config, $property) |
| 50 | 50 | { |
| 51 | - if(!array_key_exists($property, $config) || !isset($config[$property]) || $config[$property] == '' || $config[$property] == 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx') |
|
| 52 | - { |
|
| 53 | - return FALSE; |
|
| 54 | - } |
|
| 55 | - else |
|
| 56 | - { |
|
| 57 | - return TRUE; |
|
| 58 | - } |
|
| 51 | + if(!array_key_exists($property, $config) || !isset($config[$property]) || $config[$property] == '' || $config[$property] == 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx') |
|
| 52 | + { |
|
| 53 | + return FALSE; |
|
| 54 | + } |
|
| 55 | + else |
|
| 56 | + { |
|
| 57 | + return TRUE; |
|
| 58 | + } |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | function isDeviceUidInDatabase($deviceUid) |
| 62 | 62 | { |
| 63 | - $db = new DatabaseConnect(); |
|
| 64 | - $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $deviceUid . "'"); |
|
| 65 | - |
|
| 66 | - if ($result->num_rows > 0) |
|
| 67 | - { |
|
| 68 | - return TRUE; |
|
| 69 | - } |
|
| 70 | - else |
|
| 71 | - { |
|
| 72 | - return FALSE; |
|
| 73 | - } |
|
| 63 | + $db = new DatabaseConnect(); |
|
| 64 | + $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $deviceUid . "'"); |
|
| 65 | + |
|
| 66 | + if ($result->num_rows > 0) |
|
| 67 | + { |
|
| 68 | + return TRUE; |
|
| 69 | + } |
|
| 70 | + else |
|
| 71 | + { |
|
| 72 | + return FALSE; |
|
| 73 | + } |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | //Check if it's a Spider or Google Bot |
@@ -97,14 +97,14 @@ discard block |
||
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | if(configPropertyExists($config, 'karmaDeviceUid')) |
| 100 | - { |
|
| 101 | - $jodelAccountForKarma = new JodelAccount($config['karmaDeviceUid']); |
|
| 102 | - } |
|
| 103 | - else |
|
| 104 | - { |
|
| 105 | - error_log("No Karma deviceUid set in config file"); |
|
| 100 | + { |
|
| 101 | + $jodelAccountForKarma = new JodelAccount($config['karmaDeviceUid']); |
|
| 102 | + } |
|
| 103 | + else |
|
| 104 | + { |
|
| 105 | + error_log("No Karma deviceUid set in config file"); |
|
| 106 | 106 | $jodelAccountForKarma = new JodelAccount($deviceUid); |
| 107 | - } |
|
| 107 | + } |
|
| 108 | 108 | |
| 109 | 109 | /* |
| 110 | 110 | * Cunstruct View |
@@ -212,14 +212,14 @@ discard block |
||
| 212 | 212 | { |
| 213 | 213 | $jodelAccountForKarma->votePostId($_GET['postId'], $_GET['vote']); |
| 214 | 214 | if(isset($_GET['getPostDetails']) && isset($_GET['getPostDetails'])) |
| 215 | - { |
|
| 216 | - header('Location: index.php?getPostDetails=true&postId=' . htmlspecialchars($_GET['postId_parent']) . '#postId-' . htmlspecialchars($_GET['postId'])); |
|
| 217 | - } |
|
| 218 | - else |
|
| 219 | - { |
|
| 220 | - header("Location: index.php#postId-" . htmlspecialchars($_GET['postId'])); |
|
| 221 | - } |
|
| 222 | - die(); |
|
| 215 | + { |
|
| 216 | + header('Location: index.php?getPostDetails=true&postId=' . htmlspecialchars($_GET['postId_parent']) . '#postId-' . htmlspecialchars($_GET['postId'])); |
|
| 217 | + } |
|
| 218 | + else |
|
| 219 | + { |
|
| 220 | + header("Location: index.php#postId-" . htmlspecialchars($_GET['postId'])); |
|
| 221 | + } |
|
| 222 | + die(); |
|
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | //SendJodel |