modification.xml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?xml version="1.0"?>
  2. <!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
  3. <modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
  4. <id>sorunome:smf-fixes</id>
  5. <version>0.1</version>
  6. <file name="$sourcedir/Subs.php">
  7. <operation>
  8. <search position="replace"><![CDATA[$code = strtr($tag['content'], array('$1' => $data));]]></search>
  9. <add><![CDATA[if(is_array($data)){
  10. $code = strtr($tag['content'], array('$1' => $data[0]));
  11. }else{
  12. $code = strtr($tag['content'], array('$1' => $data));
  13. }]]></add>
  14. </operation>
  15. <operation>
  16. <search position="replace"><![CDATA[if (preg_match(\'~^(?:http://((?:www|au|br|ca|es|fr|de|hk|ie|in|il|it|jp|kr|mx|nl|nz|pl|ru|tw|uk)\.)?youtube\.com/(?:[^"]*?)(?:(?:video_)?id=|(?:v|p)(?:/|=)))?([0-9a-f]{16}|[0-9a-z-_]{11})~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $link, $matches))]]></search>
  17. <add><![CDATA[if (preg_match(\'~^(?:https?://((?:www|au|br|ca|es|fr|de|hk|ie|in|il|it|jp|kr|mx|nl|nz|pl|ru|tw|uk)\.)?youtube\.com/(?:[^"]*?)(?:(?:video_)?id=|(?:v|p)(?:/|=)))?([0-9a-f]{16}|[0-9a-z-_]{11})~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $link, $matches))]]></add>
  18. </operation>
  19. </file>
  20. <file name="$themedir/index.template.php">
  21. <operation>
  22. <search position="after"><![CDATA[foreach ($context['menu_buttons'] as $act => $button)
  23. {
  24. ]]></search>
  25. <add><![CDATA[if(!isset($button['href']) || !isset($button['title'])) continue;]]></add>
  26. </operation>
  27. </file>
  28. <file name="$sourcedir/Subs.php"> //Added by geekboy1011 2/23/15 //Why did the refactor this into Security.php in smf 2.1? really like really
  29. <operation>
  30. <search position="replace"> if (!allowedTo('moderate_board'))
  31. $timeLimit = isset($timeOverrides[$error_type]) ? $timeOverrides[$error_type] : $modSettings['spamWaitTime'];
  32. else
  33. $timeLimit = 2;</search>
  34. <add> if (!allowedTo('moderate_board'))
  35. $timeLimit = isset($timeOverrides[$error_type]) ? $timeOverrides[$error_type] : $modSettings['spamWaitTime'];
  36. else
  37. return false;;</add>
  38. </operation>
  39. <operation>
  40. <search position="replace">WHERE log_time < {int:log_time}
  41. AND log_type = {string:log_type}',</search>
  42. <add>WHERE ( log_time < {int:log_time} AND log_type = {string:log_type} )
  43. OR ( ip <> {string:ip} AND log_type = {string:log_type} )',</add>
  44. </operation>
  45. <operation>
  46. <search position="after">'log_type' => $error_type,</search>
  47. <add>
  48. 'ip' => $user_info['ip'],</add>
  49. </operation>
  50. </file>
  51. </modification>