aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-07-31 14:39:51 +0200
committerMario Vavti <mario@mariovavti.com>2018-07-31 14:39:51 +0200
commit569cd6c57ce60a5262e92998c6ad8a68a486fa41 (patch)
tree18b687d6b9b531fe70a933e7fe5d6195e02b3412
parente8aeecc4c9842d4c6b25f7b488ede9644afc5d78 (diff)
parent4e402dca7de0526b969c39d161fd715b9809ca96 (diff)
downloadvolse-hubzilla-569cd6c57ce60a5262e92998c6ad8a68a486fa41.tar.gz
volse-hubzilla-569cd6c57ce60a5262e92998c6ad8a68a486fa41.tar.bz2
volse-hubzilla-569cd6c57ce60a5262e92998c6ad8a68a486fa41.zip
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
-rw-r--r--include/network.php2
-rw-r--r--util/php2po.php21
2 files changed, 14 insertions, 9 deletions
diff --git a/include/network.php b/include/network.php
index 0d37db58d..6961bf0ba 100644
--- a/include/network.php
+++ b/include/network.php
@@ -1937,7 +1937,7 @@ function scrape_vcard($url) {
if(attribute_contains($x->getAttribute('class'),'given_name'))
$ret['given_name'] = escape_tags($x->textContent);
if(attribute_contains($x->getAttribute('class'),'family_name'))
- $ret['family_name'] = escxape_tags($x->textContent);
+ $ret['family_name'] = escape_tags($x->textContent);
if(attribute_contains($x->getAttribute('class'),'url'))
$ret['url'] = escape_tags($x->textContent);
diff --git a/util/php2po.php b/util/php2po.php
index 99578a12d..c710b86fe 100644
--- a/util/php2po.php
+++ b/util/php2po.php
@@ -26,32 +26,36 @@
$out = "";
$infile = file($pofile);
- $k="";
+ $k = "";
+ $c = "";
$ink = False;
foreach ($infile as $l) {
+ $l = trim($l, " ");
if (!preg_match("/^msgstr\[[1-9]/",$l)) {
if ($k!="" && (substr($l,0,7)=="msgstr " || substr($l,0,8)=="msgstr[0")){
$ink = False;
- $k = str_replace('\"','"',$k);
+ $k = stripslashes($k);
$v = "";
if (isset(App::$strings[$k])) {
$v = App::$strings[$k];
} else {
$k = "__ctx:".$c."__ ".$k;
- if (isset(App::$strings[$k]))
+ if (isset(App::$strings[$k])) {
$v = App::$strings[$k];
+ $c = "";
+ };
}
if (!empty($v)) {
if (is_array($v)) {
$l = "";
$n = 0;
foreach ($v as &$value) {
- $l .= "msgstr[".$n."] \"".str_replace('"','\"',$value)."\"\n";
+ $l .= "msgstr[".$n."] \"".addcslashes($value,"\"\n")."\"\n";
$n++;
}
} else {
- $l = "msgstr \"".str_replace('"','\"',$v)."\"\n";
+ $l = "msgstr \"".addcslashes($v,"\"\n")."\"\n";
}
}
}
@@ -59,17 +63,18 @@
if (substr($l,0,6)=="msgid_" || substr($l,0,7)=="msgstr[") $ink = False;
if ($ink) {
- $k .= trim($l,"\"\r\n");
+ preg_match('/^"(.*)"$/',$l,$m);
+ $k .= $m[1];
}
if (substr($l,0,6)=="msgid ") {
- preg_match('/^msgid "(.*)"/',$l,$m);
+ preg_match('/^msgid "(.*)"$/',$l,$m);
$k = $m[1];
$ink = True;
}
if (substr($l,0,8)=="msgctxt ") {
- preg_match('/^msgctxt "(.*)"/',$l,$m);
+ preg_match('/^msgctxt "(.*)"$/',$l,$m);
$c = $m[1];
}