]> git.nbdom.net Git - nb.git/commitdiff
move html_errors, tag href
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Sat, 19 Mar 2016 20:06:58 +0000 (20:06 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Sat, 19 Mar 2016 20:06:58 +0000 (20:06 +0000)
lib/php/page.php

index a3aac561f7647e1f370fee164e1d3394038cefdc..af2d83f34b852c0f948eab0c060a96ccee3ff0ff 100644 (file)
@@ -154,7 +154,12 @@ class Page extends nb {
     
     if (!is_array($content)) $content = array($content);
     $tags = array();
+
     foreach ($content as $c) {
+
+      # Add missing href from content
+      if ($tag == 'a' and !preg_match('//',$attrs)) $attrs = trim($attrs.' href="'.$c.'"');
+
       $tags[] = ''
         . '<' . $tag
           . ($attrs ? " $attrs" : "")
@@ -162,6 +167,7 @@ class Page extends nb {
         . $c
         . "</$tag>"
       ;
+
     }
     return join(NB_EOL,$tags);
     return ''
@@ -192,7 +198,6 @@ class Page extends nb {
   */
   function begin() {
 
-    if ($this->php_cli() or $this->p('txt_errors')) ini_set('html_errors', false);
     $this->headers(); 
 
     if (preg_match('/html$/',$this->content_type)) {