WordPress 3.x 版本中的彩蛋

今天我在进行博客考古活动时,得知了一个WordPress彩蛋。来源见:

http://www.kaisir.com/2010/02/the-egg-wordpress.html

http://www.codeweblog.com/wordpress的一个彩蛋/

在WordPress文章中使用Compare Revisions功能,如果两个相比较的文章ID一致,就会触发彩蛋。其效果是显示文字:

Wake up XXX…
The matrix has you.
Follow the white rabbit.
Don’t let this happen again.

这是一个致敬The Matrix的彩蛋。经过对WordPress历史版本的分析,发现该彩蛋已在4.x版本移除。通过分析3.0.2版本的文件,找到了该版本的revision.php和revision-js.php文件,并大致研究出了其实现方法。在revision.php中有这样一串代码:

// If we're comparing a revision to itself, redirect to the 'view' page for that revision or the edit page for that post

if ( $left_revision->ID == $right_revision->ID ) {

    $redirect = get_edit_post_link( $left_revision->ID );

    include( './js/revisions-js.php' );

    break;

}

而在revision-js.php中,有一串经过了eval混淆的代码,用于向用户输出彩蛋内容。

目前本人正在尝试反混淆代码,并复现这个彩蛋。如果你有兴趣,也可以下载revision-js.php进行研究。


已发布

分类

来自

标签:

评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

Captcha Code