From af7d9b6ec404af30deca0536fe3819b5f7e2547c Mon Sep 17 00:00:00 2001 From: Martin Monperrus Date: Tue, 14 Jun 2011 16:02:30 +0200 Subject: [PATCH] improved academic ouput: ?author=monperrus&academic ?author=monperrus&academic=1 author=monperrus&academic=true ?academic=monperrus author=monperrus&academic=noise are all equivalent --- bibtexbrowser.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/bibtexbrowser.php b/bibtexbrowser.php index 380ebb8..d260c4e 100755 --- a/bibtexbrowser.php +++ b/bibtexbrowser.php @@ -2853,11 +2853,22 @@ class Dispatcher { /** the academic keyword in URLs switch from a year based viey to a publication type based view */ function academic() { $this->displayer='AcademicDisplay'; - // backward compatibility - if($_GET[Q_ACADEMIC]!=true && $_GET[Q_ACADEMIC]!='') { + + + // backward compatibility with old GET API + // this is deprecated + // instead of academic=Martin+Monperrus + // you should use author=Martin+Monperrus&academic + // be careful of the semantics of === and !== + // 'foo bar' == true is true + // 123 == true is true (and whatever number different from 0 + // 0 == true is true + // '1'!=1 is **false** + if(!isset($_GET[Q_AUTHOR]) && $_GET[Q_ACADEMIC]!==true && $_GET[Q_ACADEMIC]!=='true' && $_GET[Q_ACADEMIC]!=1 && $_GET[Q_ACADEMIC]!='') { $_GET[Q_AUTHOR]=$_GET[Q_ACADEMIC]; $this->query[Q_AUTHOR]=$_GET[Q_ACADEMIC]; } + } function key() {