Changeset 28969
- Timestamp:
- Jul 6, 2014, 4:05:05 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/languages.class.php
r26998 r28969 159 159 $plg_data = implode( '', file($path.'/common.lang.php') ); 160 160 161 if ( preg_match("|Language Name: (.*)|", $plg_data, $val))161 if (preg_match("|Language Name:\\s*(.+)|", $plg_data, $val)) 162 162 { 163 163 $language['name'] = trim( $val[1] ); 164 164 $language['name'] = convert_charset($language['name'], 'utf-8', $target_charset); 165 165 } 166 if (preg_match("|Version: (.*)|", $plg_data, $val))166 if (preg_match("|Version:\\s*([\\w.-]+)|", $plg_data, $val)) 167 167 { 168 168 $language['version'] = trim($val[1]); 169 169 } 170 if ( preg_match("|Language URI: (.*)|", $plg_data, $val))170 if (preg_match("|Language URI:\\s*(https?:\\/\\/.+)|", $plg_data, $val)) 171 171 { 172 172 $language['uri'] = trim($val[1]); 173 173 } 174 if ( preg_match("|Author: (.*)|", $plg_data, $val))174 if (preg_match("|Author:\\s*(.+)|", $plg_data, $val)) 175 175 { 176 176 $language['author'] = trim($val[1]); 177 177 } 178 if ( preg_match("|Author URI: (.*)|", $plg_data, $val))178 if (preg_match("|Author URI:\\s*(https?:\\/\\/.+)|", $plg_data, $val)) 179 179 { 180 180 $language['author uri'] = trim($val[1]); … … 185 185 if (is_numeric($extension)) $language['extension'] = $extension; 186 186 } 187 187 188 // IMPORTANT SECURITY ! 188 189 $language = array_map('htmlspecialchars', $language); -
trunk/admin/include/plugins.class.php
r28695 r28969 258 258 $plg_data = file_get_contents($path.'/main.inc.php', null, null, 0, 2048); 259 259 260 if ( preg_match("|Plugin Name: (.*)|", $plg_data, $val))260 if (preg_match("|Plugin Name:\\s*(.+)|", $plg_data, $val)) 261 261 { 262 262 $plugin['name'] = trim( $val[1] ); 263 263 } 264 if (preg_match("|Version: (.*)|", $plg_data, $val))264 if (preg_match("|Version:\\s*([\\w.-]+)|", $plg_data, $val)) 265 265 { 266 266 $plugin['version'] = trim($val[1]); 267 267 } 268 if ( preg_match("|Plugin URI: (.*)|", $plg_data, $val))268 if (preg_match("|Plugin URI:\\s*(https?:\\/\\/.+)|", $plg_data, $val)) 269 269 { 270 270 $plugin['uri'] = trim($val[1]); … … 274 274 $plugin['description'] = trim($desc); 275 275 } 276 elseif ( preg_match("|Description: (.*)|", $plg_data, $val))276 elseif (preg_match("|Description:\\s*(.+)|", $plg_data, $val)) 277 277 { 278 278 $plugin['description'] = trim($val[1]); 279 279 } 280 if ( preg_match("|Author: (.*)|", $plg_data, $val))280 if (preg_match("|Author:\\s*(.+)|", $plg_data, $val)) 281 281 { 282 282 $plugin['author'] = trim($val[1]); 283 283 } 284 if ( preg_match("|Author URI: (.*)|", $plg_data, $val))284 if (preg_match("|Author URI:\\s*(https?:\\/\\/.+)|", $plg_data, $val)) 285 285 { 286 286 $plugin['author uri'] = trim($val[1]); … … 291 291 if (is_numeric($extension)) $plugin['extension'] = $extension; 292 292 } 293 293 294 // IMPORTANT SECURITY ! 294 295 $plugin = array_map('htmlspecialchars', $plugin); -
trunk/admin/include/themes.class.php
r28651 r28969 376 376 'mobile' => false, 377 377 ); 378 $theme_data = implode( '', file($path.'/themeconf.inc.php'));379 380 if ( preg_match("|Theme Name: (.*)|", $theme_data, $val))378 $theme_data = implode('', file($path.'/themeconf.inc.php')); 379 380 if (preg_match("|Theme Name:\\s*(.+)|", $theme_data, $val)) 381 381 { 382 382 $theme['name'] = trim( $val[1] ); 383 383 } 384 if (preg_match("|Version: (.*)|", $theme_data, $val))384 if (preg_match("|Version:\\s*([\\w.-]+)|", $theme_data, $val)) 385 385 { 386 386 $theme['version'] = trim($val[1]); 387 387 } 388 if ( preg_match("|Theme URI: (.*)|", $theme_data, $val))388 if (preg_match("|Theme URI:\\s*(https?:\\/\\/.+)|", $theme_data, $val)) 389 389 { 390 390 $theme['uri'] = trim($val[1]); … … 394 394 $theme['description'] = trim($desc); 395 395 } 396 elseif ( preg_match("|Description: (.*)|", $theme_data, $val))396 elseif (preg_match("|Description:\\s*(.+)|", $theme_data, $val)) 397 397 { 398 398 $theme['description'] = trim($val[1]); 399 399 } 400 if ( preg_match("|Author: (.*)|", $theme_data, $val))400 if (preg_match("|Author:\\s*(.+)|", $theme_data, $val)) 401 401 { 402 402 $theme['author'] = trim($val[1]); 403 403 } 404 if ( preg_match("|Author URI: (.*)|", $theme_data, $val))404 if (preg_match("|Author URI:\\s*(https?:\\/\\/.+)|", $theme_data, $val)) 405 405 { 406 406 $theme['author uri'] = trim($val[1]); -
trunk/include/functions_plugins.inc.php
r28651 r28969 381 381 if ($i < 2) continue; // first lines are typically "<?php" and "/*" 382 382 383 if (preg_match(' #Version: ([\\w.-]+)#', $line, $matches))383 if (preg_match('/Version:\\s*([\\w.-]+)/', $line, $matches)) 384 384 { 385 385 $fs_version = $matches[1];
Note: See TracChangeset
for help on using the changeset viewer.