Modulo Meta Tags - E' stato hackato nel codice per trimmare la description a 150 caratteri aggiungendo:
Dopo questo...
$value = $this->getValue($options);
if (strlen($value) === 0) {
return array();
}
inserire questo:
// Shorten description to max 180 characters (mod flavio)
if ($this->info['name'] == 'description' || $this->info['name'] == 'og:description') {
// Delete linebreaks
$value = str_replace ("\r\n", " " , $value);
$value = str_replace ("\n", " " , $value);
// Shorten value
$lines = explode("\##", wordwrap($value, 150, "\##"));
$value = trim($lines[0]);
}
***
Pattern iniziale completo Product ITA:
[node:field-genere:i18n-name]/[node:field-gruppo:i18n-name]/[node:field-nuovo-usato:i18n-name]/[node:field-marca:i18n-name]/[node:title]
***
Patch su includes/locale.inc b/includes/locale.inc per eliminare un warning
+/- riga 1489
diff --git a/includes/locale.inc b/includes/locale.inc
index c168da0..a66bd88 100644
--- a/includes/locale.inc
+++ b/includes/locale.inc
@@ -1485,7 +1485,28 @@ function _locale_parse_js_file($filepath) {
$parsed_url = drupal_parse_url($filepath);
$filepath = $parsed_url['path'];
// Load the JavaScript file.
- $file = file_get_contents($filepath);
+ $uri = @parse_url($filepath);
+ if ($uri == FALSE) {
+ drupal_set_message(t('Unable to parse js url.'), 'error');
+ return;
+ }
+
+ if (!isset($uri['scheme'])) {
+ global $base_url;
+ $streamed_filepath = $base_url . '/' . $filepath;
+ }
+ elseif (in_array($uri['scheme'], array('http', 'https', 'proxy'))) {
+ // drupal_http_request() supports only these three stream wrappers.
+ $streamed_filepath = $filepath;
+ }
+ else {
+ drupal_set_message(t('Unsupported js file stream wrapper.'), 'error');
+ return;
+ }
+ // Prefering drupal_http_request() to file_get_contents().
+ // drupal_http_request() needs a fully qualified uri. In the locales_source
+ // table, however, we store $filepath.
+ $file = drupal_http_request($streamed_filepath)->data;
// Match all calls to Drupal.t() in an array.
// Note: \s also matches newlines with the 's' modifier.
Vedi: https://www.drupal.org/node/1814980 e https://www.drupal.org/files/locale_drupal_http_request-1814980-17.patch
***