Changeset 3739429 for hippoo/trunk/app/rest.php
- Timestamp:
- 10/11/2026 11:37:56 AM (6 days ago)
- File:
-
- 1 edited
-
hippoo/trunk/app/rest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
hippoo/trunk/app/rest.php
r3731411 r3739429 407 407 <script type="text/javascript"> 408 408 window.onload = function() { 409 window.location.href = "{{LINK}}";409 window.location.href = {{LINK}}; 410 410 }; 411 411 </script> … … 418 418 </html>'; 419 419 420 $html = str_replace( array( '{{TITLE}}', '{{DESC}}' ), array( $title, $desc ), $html ); 421 422 if ( ! empty( $request['token_id'] ) ) { 420 $html = str_replace( 421 array( '{{TITLE}}', '{{DESC}}' ), 422 array( esc_html( $title ), esc_html( $desc ) ), 423 $html 424 ); 425 426 $url_params = $request->get_url_params(); 427 $token_id = isset( $url_params['token_id'] ) ? $url_params['token_id'] : ''; 428 429 if ( ! preg_match( '/^[a-zA-Z0-9_-]+$/', $token_id ) ) { 430 return new WP_REST_Response( array( 'Message' => __( 'Invalid token.', 'hippoo' ) ), 400 ); 431 } 432 433 if ( ! empty( $token_id ) ) { 423 434 $msg = __( 'You can get the data from here', 'hippoo' ); 424 $link = 'hippoo://app/login/?token=' . $request['token_id']; 425 $html = str_replace( array( '{{LINK}}', '{{MSG}}' ), array( $link, $msg ), $html ); 435 $link = 'hippoo://app/login/?token=' . $token_id; 436 $html = str_replace( 437 array( '{{LINK}}', '{{MSG}}' ), 438 array( wp_json_encode( $link ), esc_html( $msg ) ), 439 $html 440 ); 426 441 } else { 427 442 $html = str_replace( '{{MSG}}', __( 'Unauthenticated, No Token Data', 'hippoo' ), $html );
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)