Changeset 632485
- Timestamp:
- 11/30/2012 11:20:14 PM (13 years ago)
- Location:
- wp-spreadshirt
- Files:
-
- 4 edited
- 1 copied
-
tags/1.6.2 (copied) (copied from wp-spreadshirt/trunk)
-
tags/1.6.2/readme.txt (modified) (2 diffs)
-
tags/1.6.2/wp-spreadshirt.php (modified) (6 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wp-spreadshirt.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-spreadshirt/tags/1.6.2/readme.txt
r626825 r632485 5 5 Requires at least: 3.0.1 6 6 Tested up to: 3.5 7 Stable tag: 1.6. 17 Stable tag: 1.6.2 8 8 9 9 Adding a shortcode to show your Spreadshirt-Articles in a page or post. … … 30 30 31 31 == Changelog == 32 33 = 1.6.2 = 34 * More sanitizing of article-uri. Spreadshirt has a very inconsistent way to rewrite special chars -.- 32 35 33 36 = 1.6.1 = -
wp-spreadshirt/tags/1.6.2/wp-spreadshirt.php
r626825 r632485 4 4 * Plugin URI: http://ppfeufer.de/wordpress-plugin/wp-spreadshirt/ 5 5 * Description: Adding a shortcode to show your Spreadshirt-Articles in a page or post. 6 * Version: 1.6. 16 * Version: 1.6.2 7 7 * Author: H.-Peter Pfeufer 8 8 * Author URI: http://ppfeufer.de … … 218 218 'ü', 219 219 'Ü', 220 'ß' 220 'ß', 221 '\'' 221 222 ); 222 223 $array_Replace = array( … … 231 232 'ue', 232 233 'ue', 233 'ss' 234 'ss', 235 '-' 234 236 ); 235 237 … … 247 249 */ 248 250 if(preg_match('/\/shop\//', $var_sShopUri)) { 251 252 $var_sArticleUri = preg_replace('/\/shop\//', '', $var_sShopUri) . $var_sArticleUri . '-A' . (int) $article->attributes()->id; 253 } else { 249 254 $var_sArticleUri = $var_sShopUri . $var_sArticleUri . '-A' . (int) $article->attributes()->id; 250 } else {251 $var_sArticleUri = $var_sShopUri . 'shop/' . $var_sArticleUri . '-A' . (int) $article->attributes()->id;252 255 } // END if(preg_match('/\/shop\//', $var_sShopUri)) 253 256 … … 255 258 'article-name' => (string) $obj_ArticleData->name, 256 259 'article-description' => (string) $obj_ArticleData->description, 257 'article-uri' => $ var_sArticleUri,260 'article-uri' => $this->reduce_dashes($var_sArticleUri, '-', 1), 258 261 'article-image' => (string) $article->resources->resource->attributes('http://www.w3.org/1999/xlink'), 259 262 'article-price-vatExcluded' => (string) $obj_ArticleData->price->vatExcluded, … … 277 280 278 281 /** 282 * mehrfach wiederholende Zeichen aus einem String entfernen 283 * 284 * @param string $string Zu bearbeitender String 285 * @param string $chars Zeichen die beachtet werden sollen 286 * @param int $maxRepeats 287 * @return string 288 * 289 * @since 1.6.2 290 * @author ppfeufer 291 */ 292 private function reduce_dashes($var_sString, $var_sChars, $var_iMaxRepeats) { 293 $patternParts = array(); 294 295 foreach(str_split($var_sChars) as $char) { 296 $patternParts[] = sprintf('%s{%d,}', $char, $var_iMaxRepeats); 297 } 298 299 $var_sString = preg_replace_callback( 300 sprintf('/%s/i', join('|', $patternParts)), 301 create_function('$matches', 'return $matches[0][0];'), 302 $var_sString 303 ); 304 305 return $var_sString; 306 } 307 308 /** 279 309 * Etwas CSS in den <head> schubsen 280 310 * -
wp-spreadshirt/trunk/readme.txt
r626825 r632485 5 5 Requires at least: 3.0.1 6 6 Tested up to: 3.5 7 Stable tag: 1.6. 17 Stable tag: 1.6.2 8 8 9 9 Adding a shortcode to show your Spreadshirt-Articles in a page or post. … … 30 30 31 31 == Changelog == 32 33 = 1.6.2 = 34 * More sanitizing of article-uri. Spreadshirt has a very inconsistent way to rewrite special chars -.- 32 35 33 36 = 1.6.1 = -
wp-spreadshirt/trunk/wp-spreadshirt.php
r626825 r632485 4 4 * Plugin URI: http://ppfeufer.de/wordpress-plugin/wp-spreadshirt/ 5 5 * Description: Adding a shortcode to show your Spreadshirt-Articles in a page or post. 6 * Version: 1.6. 16 * Version: 1.6.2 7 7 * Author: H.-Peter Pfeufer 8 8 * Author URI: http://ppfeufer.de … … 218 218 'ü', 219 219 'Ü', 220 'ß' 220 'ß', 221 '\'' 221 222 ); 222 223 $array_Replace = array( … … 231 232 'ue', 232 233 'ue', 233 'ss' 234 'ss', 235 '-' 234 236 ); 235 237 … … 247 249 */ 248 250 if(preg_match('/\/shop\//', $var_sShopUri)) { 251 252 $var_sArticleUri = preg_replace('/\/shop\//', '', $var_sShopUri) . $var_sArticleUri . '-A' . (int) $article->attributes()->id; 253 } else { 249 254 $var_sArticleUri = $var_sShopUri . $var_sArticleUri . '-A' . (int) $article->attributes()->id; 250 } else {251 $var_sArticleUri = $var_sShopUri . 'shop/' . $var_sArticleUri . '-A' . (int) $article->attributes()->id;252 255 } // END if(preg_match('/\/shop\//', $var_sShopUri)) 253 256 … … 255 258 'article-name' => (string) $obj_ArticleData->name, 256 259 'article-description' => (string) $obj_ArticleData->description, 257 'article-uri' => $ var_sArticleUri,260 'article-uri' => $this->reduce_dashes($var_sArticleUri, '-', 1), 258 261 'article-image' => (string) $article->resources->resource->attributes('http://www.w3.org/1999/xlink'), 259 262 'article-price-vatExcluded' => (string) $obj_ArticleData->price->vatExcluded, … … 277 280 278 281 /** 282 * mehrfach wiederholende Zeichen aus einem String entfernen 283 * 284 * @param string $string Zu bearbeitender String 285 * @param string $chars Zeichen die beachtet werden sollen 286 * @param int $maxRepeats 287 * @return string 288 * 289 * @since 1.6.2 290 * @author ppfeufer 291 */ 292 private function reduce_dashes($var_sString, $var_sChars, $var_iMaxRepeats) { 293 $patternParts = array(); 294 295 foreach(str_split($var_sChars) as $char) { 296 $patternParts[] = sprintf('%s{%d,}', $char, $var_iMaxRepeats); 297 } 298 299 $var_sString = preg_replace_callback( 300 sprintf('/%s/i', join('|', $patternParts)), 301 create_function('$matches', 'return $matches[0][0];'), 302 $var_sString 303 ); 304 305 return $var_sString; 306 } 307 308 /** 279 309 * Etwas CSS in den <head> schubsen 280 310 *
Note: See TracChangeset
for help on using the changeset viewer.