@@ -268,21 +268,24 @@ function SMMS_API($image)
268268 */
269269function cache_search_json ()
270270{
271+ global $ more ;
271272 $ vowels = array ("[ " , "{ " , "] " , "} " , "< " , "> " , "\r\n" , "\r" , "\n" , "- " , "' " , '" ' , '` ' , " " , ": " , "; " , '\\' , " " , "toc " );
272273 $ regex = <<<EOS
273274/<\/?[a-zA-Z]+("[^"]*"|'[^']*'|[^'">])*>|begin[\S\s]*\/begin|hermit[\S\s]*\/hermit|img[\S\s]*\/img|{{.*?}}|:.*?:/m
274275EOS ;
276+ $ more = 1 ;
275277
276278 $ posts = new WP_Query ('posts_per_page=-1&post_status=publish&post_type=post ' );
277279 while ($ posts ->have_posts ()): $ posts ->the_post ();
278- $ output .= '{"type":"post","link":" ' . get_permalink () . '","title": ' . json_encode (get_the_title ()) . ',"comments":" ' . get_comments_number ('0 ' , '1 ' , '% ' ) . '","text": ' . json_encode (str_replace ($ vowels , " " , preg_replace ($ regex , ' ' , get_the_content ()))) . '}, ' ;
280+ $ output .= '{"type":"post","link":" ' . get_permalink () . '","title": ' . json_encode (get_the_title ()) . ',"comments":" ' . get_comments_number ('0 ' , '1 ' , '% ' ) . '","text": ' . json_encode (str_replace ($ vowels , " " , preg_replace ($ regex , ' ' , apply_filters ( ' the_content ' , get_the_content () )))) . '}, ' ;
279281 endwhile ;
280282 wp_reset_postdata ();
281283
282- $ pages = get_pages ();
283- foreach ($ pages as $ page ) {
284- $ output .= '{"type":"page","link":" ' . get_page_link ($ page ) . '","title": ' . json_encode ($ page ->post_title ) . ',"comments":" ' . $ page ->comment_count . '","text": ' . json_encode (str_replace ($ vowels , " " , preg_replace ($ regex , ' ' , $ page ->post_content ))) . '}, ' ;
285- }
284+ $ pages = new WP_Query ('posts_per_page=-1&post_status=publish&post_type=page ' );
285+ while ($ pages ->have_posts ()): $ pages ->the_post ();
286+ $ output .= '{"type":"page","link":" ' . get_permalink () . '","title": ' . json_encode (get_the_title ()) . ',"comments":" ' . get_comments_number ('0 ' , '1 ' , '% ' ) . '","text": ' . json_encode (str_replace ($ vowels , " " , preg_replace ($ regex , ' ' , apply_filters ( 'the_content ' , get_the_content ())))) . '}, ' ;
287+ endwhile ;
288+ wp_reset_postdata ();
286289
287290 $ tags = get_tags ();
288291 foreach ($ tags as $ tag ) {
@@ -402,7 +405,7 @@ function get_qq_avatar(){
402405 $ encrypted =$ _GET ["qq " ];
403406 if (isset ($ encrypted )){
404407 $ iv = str_repeat ($ sakura_privkey , 2 );
405- $ encrypted = urldecode ( base64_decode ($ encrypted ));
408+ $ encrypted = base64_decode ( urldecode ($ encrypted ));
406409 $ qq_number = openssl_decrypt ($ encrypted , 'aes-128-cbc ' , $ sakura_privkey , 0 , $ iv );
407410 preg_match ('/^\d{3,}$/ ' , $ qq_number , $ matches );
408411 $ imgurl ='https://q2.qlogo.cn/headimg_dl?dst_uin= ' .$ matches [0 ].'&spec=100 ' ;
0 commit comments