]> git.mxchange.org Git - friendica.git/blobdiff - include/template_processor.php
fix banner in duepuntozero
[friendica.git] / include / template_processor.php
index be40a31ab52b6c1ca595038809137ac52bd20bf7..a0dfad1697fe2f927f81a69cb0124d5a8d5b5e56 100644 (file)
@@ -16,7 +16,8 @@
                            case PREG_BAD_UTF8_ERROR: die('PREG_BAD_UTF8_ERROR'); break;
                            case PREG_BAD_UTF8_OFFSET_ERROR: die('PREG_BAD_UTF8_OFFSET_ERROR'); break;
                            default:
-                                       die("Unknown preg error.");
+                                       //die("Unknown preg error.");
+                                       return;
                        }
                }
                
                        } else {
                                $val = $this->_get_var($args[2]);
                        }
-                       if (isset($args[4])) {
-                               list($strue, $sfalse)= explode($args[4], $args[3]);
-                       } else {
-                               $strue = $args[3]; $sfalse = "";
-                       }
+                       list($strue, $sfalse)= preg_split("|{{ *else *}}|", $args[3]);
                        
                        return ($val?$strue:$sfalse);
                }
                                $s = "";
                        }
                        $s = preg_replace_callback('/\|\|([0-9]+)\|\|/', array($this, "_replcb_node"), $s);
-                       if ($s==Null) $this->_preg_error()      
                        return $s;
                }
                                                
                        #$s = str_replace(array("\n","\r"),array("§n§","§r§"),$s);
                        $s = $this->_build_nodes($s);
                        $s = preg_replace_callback('/\|\|([0-9]+)\|\|/', array($this, "_replcb_node"), $s);
-                       if ($s==Null) $this->_preg_error()
+                       if ($s==Null) $this->_preg_error();
                        $s = str_replace($this->search,$this->replace, $s);
                        
                        return $s;