<?xml version="1.0"?>
<?xml-stylesheet
href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"
?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel rdf:about="http://pear.php.net/bugs/search.php">
    <title>PEAR Bug Search Results</title>
    <link>http://pear.php.net/bugs/search.php?cmd=display&amp;package_name%5B0%5D=Structures_BibTex</link>
    <description>Search Results</description>
    <dc:language>en-us</dc:language>
    <dc:creator>pear-webmaster@lists.php.net</dc:creator>
    <dc:publisher>pear-webmaster@lists.php.net</dc:publisher>
    <admin:generatorAgent rdf:resource="http://pear.php.net/bugs"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    <items>
     <rdf:Seq>
      <rdf:li rdf:resource="http://pear.php.net/bug/20109" />
      <rdf:li rdf:resource="http://pear.php.net/bug/19948" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16477" />
      <rdf:li rdf:resource="http://pear.php.net/bug/13100" />

     </rdf:Seq>
    </items>
  </channel>

  <image rdf:about="http://pear.php.net/gifs/pearsmall.gif">
    <title>PEAR Bugs</title>
    <url>http://pear.php.net/gifs/pearsmall.gif</url>
    <link>http://pear.php.net/bugs</link>
  </image>

    <item rdf:about="http://pear.php.net/bug/20109">
      <title>Structures_BibTex: Bug 20109 [Open] package.xml does not validate</title>
      <link>http://pear.php.net/bugs/20109</link>
      <content:encoded><![CDATA[<pre>Structures_BibTex Bug
Reported by cweiske
2013-11-04T18:55:29+00:00
PHP: Irrelevant OS:  Package Version: 1.0.0RC6

Description:
------------
The package.xml file does not validate against the XSD file:

Structures_BibTex$ xmllint --schema ../package-2.0.xsd --noout package.xml  
package.xml:62: element notes: Schemas validity error : Element '{http://pear.php.net/dtd/package-2.0}notes': This element is not expected. Expected is ( {http://pear.php.net/dtd/package-2.0}date ).
package.xml:82: element notes: Schemas validity error : Element '{http://pear.php.net/dtd/package-2.0}notes': This element is not expected. Expected is ( {http://pear.php.net/dtd/package-2.0}date ).
package.xml:96: element notes: Schemas validity error : Element '{http://pear.php.net/dtd/package-2.0}notes': This element is not expected. Expected is ( {http://pear.php.net/dtd/package-2.0}date ).
package.xml:110: element notes: Schemas validity error : Element '{http://pear.php.net/dtd/package-2.0}notes': This element is not expected. Expected is ( {http://pear.php.net/dtd/package-2.0}date ).
package.xml fails to validate</pre>]]></content:encoded>
      <description><![CDATA[<pre>Structures_BibTex Bug
Reported by cweiske
2013-11-04T18:55:29+00:00
PHP: Irrelevant OS:  Package Version: 1.0.0RC6

Description:
------------
The package.xml file does not validate against the XSD file:

Structures_BibTex$ xmllint --schema ../package-2.0.xsd --noout package.xml  
package.xml:62: element notes: Schemas validity error : Element '{http://pear.php.net/dtd/package-2.0}notes': This element is not expected. Expected is ( {http://pear.php.net/dtd/package-2.0}date ).
package.xml:82: element notes: Schemas validity error : Element '{http://pear.php.net/dtd/package-2.0}notes': This element is not expected. Expected is ( {http://pear.php.net/dtd/package-2.0}date ).
package.xml:96: element notes: Schemas validity error : Element '{http://pear.php.net/dtd/package-2.0}notes': This element is not expected. Expected is ( {http://pear.php.net/dtd/package-2.0}date ).
package.xml:110: element notes: Schemas validity error : Element '{http://pear.php.net/dtd/package-2.0}notes': This element is not expected. Expected is ( {http://pear.php.net/dtd/package-2.0}date ).
package.xml fails to validate</pre>]]></description>
      <dc:date>2013-11-04T18:55:29+00:00</dc:date>
      <dc:creator>cweiske &amp;#x61;&amp;#116; php &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>Structures_BibTex Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/19948">
      <title>Structures_BibTex: Bug 19948 [Open] Exported bibtex has double commas in authors</title>
      <link>http://pear.php.net/bugs/19948</link>
      <content:encoded><![CDATA[<pre>Structures_BibTex Bug
Reported by spandecks
2013-05-16T14:58:34+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 1.0.0RC6

Description:
------------
VON LAST, JR, FIRST formats badly for anyone without &quot;jr&quot; or 
&quot;III&quot; etc after their name.

This can be fixed by inserting this around line 962... just before 
returning $ret

        $ret = str_replace(&quot; ,&quot;, ',', $ret); // Get rid of spaces 
before commas
        $ret = str_replace(&quot;,,&quot;, ',', $ret); // Get rid of double 
commas


Test script:
---------------
$bibtex = new Structures_BibTex();

$addarray = array();
$bibauthor = array();

$bibauthor['first'] = &quot;Matt&quot;;
$bibauthor['last'] = &quot;Southall&quot;;
$addarray['author'][] = $bibauthor;
$bibtex-&gt;addEntry($addarray);

print $bibtex-&gt;bibTex();


Expected result:
----------------
@ { , author = {Southall, Matt} }

Actual result:
--------------
@ { , author = {Southall, , Matt} }</pre>]]></content:encoded>
      <description><![CDATA[<pre>Structures_BibTex Bug
Reported by spandecks
2013-05-16T14:58:34+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 1.0.0RC6

Description:
------------
VON LAST, JR, FIRST formats badly for anyone without &quot;jr&quot; or 
&quot;III&quot; etc after their name.

This can be fixed by inserting this around line 962... just before 
returning $ret

        $ret = str_replace(&quot; ,&quot;, ',', $ret); // Get rid of spaces 
before commas
        $ret = str_replace(&quot;,,&quot;, ',', $ret); // Get rid of double 
commas


Test script:
---------------
$bibtex = new Structures_BibTex();

$addarray = array();
$bibauthor = array();

$bibauthor['first'] = &quot;Matt&quot;;
$bibauthor['last'] = &quot;Southall&quot;;
$addarray['author'][] = $bibauthor;
$bibtex-&gt;addEntry($addarray);

print $bibtex-&gt;bibTex();


Expected result:
----------------
@ { , author = {Southall, Matt} }

Actual result:
--------------
@ { , author = {Southall, , Matt} }</pre>]]></description>
      <dc:date>2013-05-16T14:58:34+00:00</dc:date>
      <dc:creator>matt &amp;#x64;&amp;#111;&amp;#x74; southall &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Structures_BibTex Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16477">
      <title>Structures_BibTex: Bug 16477 [Open] Infinite loop in the parser when a comma is missing</title>
      <link>http://pear.php.net/bugs/16477</link>
      <content:encoded><![CDATA[<pre>Structures_BibTex Bug
Reported by arnoques
2009-07-28T05:50:47+00:00
PHP: 5.1.2 OS: Linux Package Version: CVS

Description:
------------
The parser also gets into an infinite loop when processing an entry like this:

@ARTICLE{key,
  author = {LastName, Name}
  title = {a title},
  journal = {a journal}
}

It gets confused because the parser searches for titles between a ',' and a '=', so it believes that &quot;Name}\n\ttitle&quot; is the name of the field. The infinite loop is triggered in the while loop at lines 383-393, when the parser assumes that, since the braces are not balanced in &quot;= {LastName,&quot; there must be a previous &quot;=&quot;.

If there's no comma inside the author field, the program still gets confused but it doesn't trigger the infinite loop.

I agree with the submitter of a previous bug that the parser needs a serious rewrite. It should accept and reject the same inputs that the original bibtex program does.

Test script:
---------------
Run the script on the previous entry

require_once 'BibTex.php';
$bibtex = new Structures_BibTex();
$ret    = $bibtex-&gt;loadFile('test.bib');
$bibtex-&gt;parse();
print_r($bibtex-&gt;warnings);

Expected result:
----------------
An error stating that there is a missing comma (and several warning due to missing fields, but I know that's not yet implemented).

The output of bibtex is
~$ bibtex test
This is BibTeX, Version 0.99c (Web2C 7.5.4)
The top-level auxiliary file: test.aux
The style file: plain.bst
Database file #1: test.bib
I was expecting a `,' or a `}'---line 3 of file test.bib
 :
 :   title = {a title},
(Error may have been on previous line)
I'm skipping whatever remains of this entry
Warning--empty title in key
Warning--empty journal in key
Warning--empty year in key
(There was 1 error message)


Actual result:
--------------
Infinite loop at lines 383-393</pre>]]></content:encoded>
      <description><![CDATA[<pre>Structures_BibTex Bug
Reported by arnoques
2009-07-28T05:50:47+00:00
PHP: 5.1.2 OS: Linux Package Version: CVS

Description:
------------
The parser also gets into an infinite loop when processing an entry like this:

@ARTICLE{key,
  author = {LastName, Name}
  title = {a title},
  journal = {a journal}
}

It gets confused because the parser searches for titles between a ',' and a '=', so it believes that &quot;Name}\n\ttitle&quot; is the name of the field. The infinite loop is triggered in the while loop at lines 383-393, when the parser assumes that, since the braces are not balanced in &quot;= {LastName,&quot; there must be a previous &quot;=&quot;.

If there's no comma inside the author field, the program still gets confused but it doesn't trigger the infinite loop.

I agree with the submitter of a previous bug that the parser needs a serious rewrite. It should accept and reject the same inputs that the original bibtex program does.

Test script:
---------------
Run the script on the previous entry

require_once 'BibTex.php';
$bibtex = new Structures_BibTex();
$ret    = $bibtex-&gt;loadFile('test.bib');
$bibtex-&gt;parse();
print_r($bibtex-&gt;warnings);

Expected result:
----------------
An error stating that there is a missing comma (and several warning due to missing fields, but I know that's not yet implemented).

The output of bibtex is
~$ bibtex test
This is BibTeX, Version 0.99c (Web2C 7.5.4)
The top-level auxiliary file: test.aux
The style file: plain.bst
Database file #1: test.bib
I was expecting a `,' or a `}'---line 3 of file test.bib
 :
 :   title = {a title},
(Error may have been on previous line)
I'm skipping whatever remains of this entry
Warning--empty title in key
Warning--empty journal in key
Warning--empty year in key
(There was 1 error message)


Actual result:
--------------
Infinite loop at lines 383-393</pre>]]></description>
      <dc:date>2009-07-28T05:50:47+00:00</dc:date>
      <dc:creator>arnoques &amp;#x61;&amp;#116; yahoo &amp;#x64;&amp;#111;&amp;#x74; com &amp;#x64;&amp;#111;&amp;#x74; ar</dc:creator>
      <dc:subject>Structures_BibTex Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/13100">
      <title>Structures_BibTex: Bug 13100 [Open] parser gets hung</title>
      <link>http://pear.php.net/bugs/13100</link>
      <content:encoded><![CDATA[<pre>Structures_BibTex Bug
Reported by alexis
2008-02-11T14:11:02+00:00
PHP: 5.2.0 OS: Linux Package Version: 1.0.0RC4

Description:
------------
The file-parsing code does not handle strings properly, and gets confused when @ signs appear in strings (as in \latex@macro). The test below is distilled from my preamble.

Frankly, parse() and parseEntry() are a terrible mess and should be refactored into a state machine that distinguishes top-level, in-entry and in-string states. The first embedded @ in the test triggers a warning TWICE, then the second gets stuck in the loop...

Test script:
---------------
cat &gt; example.php
  @PREAMBLE{ &quot;{@url} @...&quot; }
^D


Expected result:
----------------
The code should terminate

Actual result:
--------------
infinite loop</pre>]]></content:encoded>
      <description><![CDATA[<pre>Structures_BibTex Bug
Reported by alexis
2008-02-11T14:11:02+00:00
PHP: 5.2.0 OS: Linux Package Version: 1.0.0RC4

Description:
------------
The file-parsing code does not handle strings properly, and gets confused when @ signs appear in strings (as in \latex@macro). The test below is distilled from my preamble.

Frankly, parse() and parseEntry() are a terrible mess and should be refactored into a state machine that distinguishes top-level, in-entry and in-string states. The first embedded @ in the test triggers a warning TWICE, then the second gets stuck in the loop...

Test script:
---------------
cat &gt; example.php
  @PREAMBLE{ &quot;{@url} @...&quot; }
^D


Expected result:
----------------
The code should terminate

Actual result:
--------------
infinite loop</pre>]]></description>
      <dc:date>2008-02-11T14:11:02+00:00</dc:date>
      <dc:creator>alexis &amp;#x61;&amp;#116; ling &amp;#x64;&amp;#111;&amp;#x74; upenn &amp;#x64;&amp;#111;&amp;#x74; edu</dc:creator>
      <dc:subject>Structures_BibTex Bug</dc:subject>
    </item>
</rdf:RDF>
