Skip to content

Commit 8f66b70

Browse files
committed
filter out wrongly kept EN description on non-EN locales
1 parent 841ac58 commit 8f66b70

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

google-play.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ public function parseApplication($packageName, $lang='en_US', $loc='US') {
101101

102102
$values["summary"] = '';
103103
$values["description"] = $this->getRegVal('/itemprop="description"><span jsslot><div jsname="sngebd">(?<content>.*?)<\/div><\/span><div/i');
104+
if ( strtolower(substr($lang,0,2)) != 'en' ) { // Google sometimes keeps the EN description additionally, so we need to filter it out
105+
if ($this->debug) echo "Original Description:\n" . $values["description"] . "\n\n";
106+
$values["description"] = preg_replace('!.*?<div jsname="Igi1ac" style="display:none;">(.+)!ims', '$1', $values["description"]);
107+
}
104108
$values["icon"] = $this->getRegVal('/<div class="hkhL9e"><div class="xSyT2c"><img src="(?<content>[^\"]+)"/i');
105109
$values["featureGraphic"] = preg_replace('!(.*)=w\d+.*!i', '$1', $this->getRegVal('/<meta name="twitter:image" content="(?<content>[^\"]+)"/i'));
106110

0 commit comments

Comments
 (0)