Skip to content

Commit 2ecf342

Browse files
committed
new public token
1 parent 54fe3de commit 2ecf342

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/thingiverse.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ public static function get_authorization_token(){
3838
$cached_token = Thingiverse::get_object_from_cache($cached_token_key);
3939
if(false === $cached_token){
4040
$js = file_get_contents(Thingiverse::TOKEN_URL);
41-
preg_match_all('/,u="[a-zA-Z0-9]*[a-zA-Z][0-9][a-zA-Z0-9]*+"/', $js, $matches);
41+
preg_match_all('/="[a-zA-Z0-9]*[a-zA-Z][0-9][a-zA-Z0-9]*+"/', $js, $matches);
4242
$text = $matches[0];
43-
$token = substr($text[0],strrpos($text[0], 'u=')+3,-1);
43+
$token = substr($text[0],strrpos($text[0], '=')+2,-1);
4444
Thingiverse::log_message("Renewing KEY: ".$cached_token_key."=".$token);
4545
set_transient($cached_token_key, $token, Thingiverse::CACHE_TTL_TOKEN);
4646
return $token;

0 commit comments

Comments
 (0)